Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 01:06 25 Nov 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : DM counting input numbers

     Page 1 of 2    
Author Message
herbnz

Senior Member

Joined: 18/02/2007
Location: New Zealand
Posts: 258
Posted: 04:40am 17 Dec 2011
Copy link to clipboard 
Print this post

Hi
Trying to set up a counting routine but confused with pin numbers

PIN(4)→ ARDUINO.A3 GPIO.15 AI, DI, , , , , , DO,
PIN(5)→ ARDUINO.A4 GPIO.13 AI, DI, FI, PI, CI, IP, IN, DO,
PIN(6)→ ARDUINO.A5 GPIO.11 AI, DI, FI, PI, CI, IP, IN, DO,
PIN(7)→ ARDUINO.D10 GPIO.9 AI, DI, FI, PI, CI, IP, IN, DO,
PIN(8)→ ARDUINO.D11 GPIO.7 , DI, , , , , , DO, OC

From the user manual pin(5) or 6 or 7 should accept setpin (),5
but only the GPIO numbers 13,11,9 are accepted
what ARDUINO connection is this A5 ??
feeding pulses here in prog below do not seem to register


10 SETPIN 11,5
20 PRINT PIN(11)
30 PAUSE 1000
40 GOTO 2
 
Keith @

Senior Member

Joined: 19/06/2011
Location: Australia
Posts: 167
Posted: 04:49am 17 Dec 2011
Copy link to clipboard 
Print this post


which manual are you referring to ?

which board are you using ?


The more we know, the more we know we don't know !
 
herbnz

Senior Member

Joined: 18/02/2007
Location: New Zealand
Posts: 258
Posted: 04:52am 17 Dec 2011
Copy link to clipboard 
Print this post

Duinomite user manual and device

Herb
 
Keith @

Senior Member

Joined: 19/06/2011
Location: Australia
Posts: 167
Posted: 05:32am 17 Dec 2011
Copy link to clipboard 
Print this post

Herb

Confusing is not the word to use ... hell we're stuck with a crap situation every time we want to code or connect with all the different standards/designs .. life wasn't meant to be easy but it didn't need to be made hard either.

The code seems ok except for goto 2 however it appears pin 11 can't be set as CI and you need to watch out for clashing on pin7 if using an SD card.

This is what I get from the manual ...

PIN(5) → ARDUINO.A4 13 AI, DI, FI, PI, CI, IP, IN, DO,
PIN(6) → ARDUINO.A5 11 AI, DI, FI, PI, CI, IP, IN, DO,
PIN(7) → ARDUINO.D10 9 AI, DI, FI, PI, CI, IP, IN, DO,

These are the only ones that are marked for CI (counter input) and when using the config setting of 5 to set up the Counting input in the SETPIN keep in mind these limitations ...counts pulses up to 200KHz pulse width 10nS or more.

Keith
The more we know, the more we know we don't know !
 
herbnz

Senior Member

Joined: 18/02/2007
Location: New Zealand
Posts: 258
Posted: 05:40am 17 Dec 2011
Copy link to clipboard 
Print this post

  Keith @ said   Herb


The code seems ok except for goto 2 however it appears pin 11 can't be set as CI and you need to watch out for clashing on pin7 if using an SD card.



Keith

Hi goto 2 should be goto 20 got chopped in copying

Herb
 
Keith @

Senior Member

Joined: 19/06/2011
Location: Australia
Posts: 167
Posted: 06:02am 17 Dec 2011
Copy link to clipboard 
Print this post

Herb

just in case you want to reset the count between each PAUSE see the following from the manual.

PIN() Function
Purpose:
To read from a specified external GPIO port.
Syntax:
PIN(n)

For GPIO ports initialized with SETPIN command as Count input, will return the count since reset (counting is done on the positive rising edge). The count input can be reset to zero by resetting the pin to counting input (even if it is already so configured).

Keith
The more we know, the more we know we don't know !
 
Keith @

Senior Member

Joined: 19/06/2011
Location: Australia
Posts: 167
Posted: 08:07am 17 Dec 2011
Copy link to clipboard 
Print this post

Olimex

There appears to be a problem with the GPIO chart in the manual (3.7.GPIO Chapter page 19)

Geoff refers to CI as available on MMBasic PIN(11),(12),(13),(14) which are pins 4,6,8,10 on the 26way header.

The diagram on page 18 shows these as Arduino DO,D1,D2,D3 against PIN (11),(12),(13),(14)

so far so good

Now back to page 19

and MMBasic PIN(11),(12),(13),(14) are against Arduino D0,D1,D2,D3 and 26 way header pins 4,6,8,10 which appears to be the correct configuration.

BUT the listing shows MMBasic Reference PIN(5),(6),(7) as being CI on the 26 way header pins 13,11,9 against Arduino A4,A5,D10 ??? and one of the CI pins is not even referenced ???

KeithEdited by Keith @ 2011-12-18
The more we know, the more we know we don't know !
 
bigmik

Guru

Joined: 20/06/2011
Location: Australia
Posts: 2914
Posted: 09:19am 17 Dec 2011
Copy link to clipboard 
Print this post

  herbnz said   Hi
Trying to set up a counting routine but confused with pin numbers

PIN(4)→ ARDUINO.A3 GPIO.15 AI, DI, , , , , , DO,
PIN(5)→ ARDUINO.A4 GPIO.13 AI, DI, FI, PI, CI, IP, IN, DO,
PIN(6)→ ARDUINO.A5 GPIO.11 AI, DI, FI, PI, CI, IP, IN, DO,
PIN(7)→ ARDUINO.D10 GPIO.9 AI, DI, FI, PI, CI, IP, IN, DO,
PIN(8)→ ARDUINO.D11 GPIO.7 , DI, , , , , , DO, OC



Hi Herb, (My Fathers Name was Herb(ert).

I have just done a table for Tsvetan to consider putting in the next manual, it may make that area a bit clearer, (It may not display well on the forum but if you PM me I can email it to you (full size about 1Meg)

Let me know what you think.

Mick




Mick's uMite Stuff can be found >>> HERE (Kindly hosted by Dontronics) <<<
 
DuinoMiteMegaAn
Senior Member

Joined: 17/11/2011
Location: Australia
Posts: 231
Posted: 10:56am 17 Dec 2011
Copy link to clipboard 
Print this post

I went several steps further by including all the 5 volt tolerant pins, the explicit name descriptions/functions and whether the pins are shared or not with the other I/O connectors.

2011-12-17_205613_DuinoMiteMega_Input_Output_R3.pdf
 
Keith @

Senior Member

Joined: 19/06/2011
Location: Australia
Posts: 167
Posted: 11:42am 17 Dec 2011
Copy link to clipboard 
Print this post

Hey Guys I 'm still confused.

From the posts by Mick and DuinoMiteMegaAn I assume that I shouldn't have made a comparison and we all need to tiptoe quietly around the topic.

I've just looked at Don's website and Geoff's website and it looks like we have a conflict like that between VCR and Beta.

Keith

ps DuinoMiteMegaAn landscape orientation on your chart would be great.
The more we know, the more we know we don't know !
 
DuinoMiteMegaAn
Senior Member

Joined: 17/11/2011
Location: Australia
Posts: 231
Posted: 11:52am 17 Dec 2011
Copy link to clipboard 
Print this post

ps DuinoMiteMegaAn landscape orientation on your chart would be great.


I also released the Openoffice source code document to Don. That way you
can add/delete to it and even rotate the pdf document yourself.

BTW ... It won't fit the landscape - too much data, but it contains everything
anyone needs to know about the GPIO Pin#s. Edited by DuinoMiteMegaAn 2011-12-18
 
Keith @

Senior Member

Joined: 19/06/2011
Location: Australia
Posts: 167
Posted: 12:18pm 17 Dec 2011
Copy link to clipboard 
Print this post

I have my epiphany!! Oh what a paradigm shift! These 2 are now like comparing bees and flowers ... don't!

There you go Bert ... all yours.




The more we know, the more we know we don't know !
 
herbnz

Senior Member

Joined: 18/02/2007
Location: New Zealand
Posts: 258
Posted: 04:31pm 17 Dec 2011
Copy link to clipboard 
Print this post

Ok The charts make it clearer. I had worked out correctly then so I will now copy what happens when I try to setpin 5 to counting.
> list
10 SETPIN 5,5
20 PRINT pin (5)
30 PAUSE 1000
40 GOTO 20
> run
Error line 10: Invalid configuration value
>
but using pin 11 or 12,13,14,15 is accepted
Bug in firmware ?? or am I incorrect still

Herb Edited by herbnz 2011-12-19
 
jebz

Regular Member

Joined: 13/06/2011
Location: Australia
Posts: 79
Posted: 10:09pm 17 Dec 2011
Copy link to clipboard 
Print this post

  herbnz said  
10 SETPIN 5,5
> run
Error line 10: Invalid configuration value
>
but using pin 11 or 12,13,14,15 is accepted
Bug in firmware ??
Herb


It certainly looks like a bug in the Duinomite version of firmware.
 
bigmik

Guru

Joined: 20/06/2011
Location: Australia
Posts: 2914
Posted: 11:55pm 17 Dec 2011
Copy link to clipboard 
Print this post

  Keith @ said   I have my epiphany!! Oh what a paradigm shift! These 2 are now like comparing bees and flowers ... don't!

There you go Bert ... all yours.




Hi Keith,

Your chart differs in some areas to Mine, I need to consult Ken and Tsvetan for clarity on these...

I garnered the data from the Manual, so there could be an error there.. I also have added a +5V tolerant column and that also differs (info from manual) from yours, I have also been asked to put the CPU Pin Numbers/names into the table and am considering this but dont wish to make it more complicated than it needs to be...

Regards,

Mick


Mick's uMite Stuff can be found >>> HERE (Kindly hosted by Dontronics) <<<
 
herbnz

Senior Member

Joined: 18/02/2007
Location: New Zealand
Posts: 258
Posted: 02:03am 18 Dec 2011
Copy link to clipboard 
Print this post

If 5,6,7 are the special i/o for counting etc then the firm ware will not allow access
the firmware seems to be set to pin 11 12 13 14 15 which appears as the old Maximite code

Herb
 
Keith @

Senior Member

Joined: 19/06/2011
Location: Australia
Posts: 167
Posted: 03:30am 18 Dec 2011
Copy link to clipboard 
Print this post

  bigmik said  

Your chart differs in some areas to Mine, I need to consult Ken and Tsvetan for clarity on these...




Mick

I got the info from the Olimex web site. I assume it is one created by Tsvetan.

The confusion is really being created by the MMBasic split into a number of different streams (MaxiMite, UBW32, Olimex). The only commonality being the PIC32 MCU and even then there is probably the 64 pin and 100 pin versions (I haven't checked this as the code is now being distributed in hex only).

Evolution in action ... exciting times ... exciting challenges.

Keith


The more we know, the more we know we don't know !
 
Keith @

Senior Member

Joined: 19/06/2011
Location: Australia
Posts: 167
Posted: 03:40am 18 Dec 2011
Copy link to clipboard 
Print this post

  herbnz said   If 5,6,7 are the special i/o for counting etc then the firm ware will not allow access
the firmware seems to be set to pin 11 12 13 14 15 which appears as the old Maximite code

Herb


Yeah Herb ... I'm not surprised and I suppose you could call it a bug depending on which MMBasic version you are using.

A work around may be to use the Arduino shield pin outs that match these MMbasic pins and see what happens.

good luck

Keith
The more we know, the more we know we don't know !
 
herbnz

Senior Member

Joined: 18/02/2007
Location: New Zealand
Posts: 258
Posted: 07:38am 18 Dec 2011
Copy link to clipboard 
Print this post

tried other pins no joy
using version 2.7a
Herb
 
Keith @

Senior Member

Joined: 19/06/2011
Location: Australia
Posts: 167
Posted: 09:26am 18 Dec 2011
Copy link to clipboard 
Print this post

Herb

Firmware 2.7a is a MaxiMite version.

Duinomite is at version 2.7 and should be downloaded from Olimex or Dontronics. I note that both websites are saying that there is currently no support for PIN() ?? not sure if this also includes PIN(pin) see Commands listing.

Also I just noticed in an earlier post you used 20 PRINT pin (5) this should be PIN(5) ... no spaces and upper case

Also try a different square wave or whatever it is you are trying to count ... even a switch with 3.3v should produce a rising positive leading edge. OR use the following code from the Olimex Duinomite Manual to check an alternative arrangement for the pin before trying the CI.

In the following example, a LED connected to ARDUINO.A0 and GND will light ON when User button is pressed.
10 SETPIN 1,8
20 PIN(1) = PIN(0)
30 GOTO 20


Firmware and Manual http://www.olimex.com/dev/index.html look for Duino on the left side click on that and then click on Duinomite on the next page (bloody confusing web page design to try to copy a url)

Don's Website for Firmware and manual http://www.dontronics-shop.com/olimex-duinomite.html

Keith
The more we know, the more we know we don't know !
 
     Page 1 of 2    
Print this page
© JAQ Software 2024