Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 15:14 18 May 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 : Changing Micromite pinout?

Author Message
Modena
Newbie

Joined: 07/06/2014
Location: Australia
Posts: 10
Posted: 03:55pm 09 Jun 2014
Copy link to clipboard 
Print this post

Hi all, newbie alert. Are any of the Micromite function/pin assignments determined by the MMBasic code, and hence I could alter them by making source code alterations?

For my project I really need all 4 of the COUNT pins, but I also need to communicate with a second Micromite via I2C. Yes I could use two COUNT pins on each Micromite, but I would prefer not to do this as it will complicate the code enormously as it would require constant I2C calls to get all four COUNT outputs onto the one Micromite.

I have looked at the 44 pin version but it also seems to have 4 COUNT capable pins two of which are still shared with I2C.

Part deux: the COUNT pins seem to be updating count/frequency once/second, is there a way to change this? I need to either count the number of pulses, or otherwise obtain the frequency of an input wave, but I need a resolution more like 100ms, or perhaps even lower like every 20ms, any suggestions on how to achieve this?

Ben
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9081
Posted: 05:52pm 09 Jun 2014
Copy link to clipboard 
Print this post

To the best of my knowledge, no - the pins are fixed, so if you want to use a serial port, you have to use certain pins etc. Same with I2C, SPI etc, etc, etc.

PICAXE does have one-up on the MM here, as just about any pin can be input or output or serial in or serial out. I think the I2C and SPI pins on the PICAXE are fixed too though.
Smoke makes things work. When the smoke gets out, it stops!
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3167
Posted: 06:20pm 09 Jun 2014
Copy link to clipboard 
Print this post

The count pins use a hardware interrupt which cannot be moved to other pins, Also the I2C is also fixed to the pins that it uses. So the short answer is no, you cannot move these functions to other pins.

The count pins update once a second, you could change this by recompiling the source code but to do that you need the paid version of the compiler.

Geoff
Geoff Graham - http://geoffg.net
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9081
Posted: 06:33pm 09 Jun 2014
Copy link to clipboard 
Print this post

As a slight digression, how's San Francisco, Geoff?
Smoke makes things work. When the smoke gets out, it stops!
 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2294
Posted: 08:18pm 09 Jun 2014
Copy link to clipboard 
Print this post

  Geoffg said  
The count pins update once a second, you could change this by recompiling the source code but to do that you need the paid version of the compiler.
Geoff


geoff: how difficult would it be to make the gate time something that can be set in basic? even if there were only just three options: 1 second, 1/10th second and 1/100th second, that would be extremely useful in some situations.

could this be something to perhaps add to the list of 'requested new features' for including in those spare few K's of flash?


rob :-)
 
Modena
Newbie

Joined: 07/06/2014
Location: Australia
Posts: 10
Posted: 08:29pm 09 Jun 2014
Copy link to clipboard 
Print this post

  Geoffg said   The count pins use a hardware interrupt which cannot be moved to other pins, Also the I2C is also fixed to the pins that it uses. So the short answer is no, you cannot move these functions to other pins.

The count pins update once a second, you could change this by recompiling the source code but to do that you need the paid version of the compiler.

Geoff


thanks Geoff, that's great info. I will check it out.

robert: nice idea, that would be even better.Edited by Modena 2014-06-11
 
MicroBlocks

Guru

Joined: 12/05/2012
Location: Thailand
Posts: 2209
Posted: 09:39pm 09 Jun 2014
Copy link to clipboard 
Print this post

Pin 6 and pin 7 on the 28 pin uMite are capable of I2C as this is the second I2C peripheral in the chip.

When that peripheral is used as a second I2C then that would free up those COUNT pins.
I did not think of that when i put using the second I2C on the wishlist, it is a very good reason.
My feeling using the uMite for a while is that more and more will be done with this little 'beast' and sooner then later that second I2C will be missed.
I am not sure if it can be done because of flash limitation and/or if it is very complicated (I never got I2C working well from a C program, getting it to work is a whole feat in itself).
When the second I2C can be enabled it will not interfere with already made projects as it is an alternative use of the pins.

Edited by TZAdvantage 2014-06-11
Microblocks. Build with logic.
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3167
Posted: 06:13am 10 Jun 2014
Copy link to clipboard 
Print this post

  robert.rozee said  how difficult would it be to make the gate time something that can be set in basic?

Not difficult, although choosing the syntax will be a bit of a challenge. I will add it to the list for investigation.

TZ, I chose the current pins for i2c because they are 5V tolerant. The i2c code was written by someone else (who did a good job) but because of the way it was written it is difficult to add a second i2c port without doubling the i2c memory requirements. At some point the i2c code needs to be rewritten and then the second port can be added.

  Grogster said   As a slight digression, how's San Francisco, Geoff?

Great, it is wonderful to be enjoying the summer weather while it is cold and wet at home. Photo of the Golden Gate Bridge taken yesterday - shrouded in fog (as is usual) while the rest of SF is in brilliant sun.



Geoff Graham - http://geoffg.net
 
MicroBlocks

Guru

Joined: 12/05/2012
Location: Thailand
Posts: 2209
Posted: 06:40am 10 Jun 2014
Copy link to clipboard 
Print this post

Sittin' on the dock of the bay, watching the tide roll away.....ooh

Microblocks. Build with logic.
 
Modena
Newbie

Joined: 07/06/2014
Location: Australia
Posts: 10
Posted: 07:54pm 10 Jun 2014
Copy link to clipboard 
Print this post

  Geoffg said   The count pins use a hardware interrupt which cannot be moved to other pins, Also the I2C is also fixed to the pins that it uses. So the short answer is no, you cannot move these functions to other pins.

The count pins update once a second, you could change this by recompiling the source code but to do that you need the paid version of the compiler.

Geoff


Geoff, are you referring to these compilers?

http://www.microchip.com/pagehandler/en_us/devtools/mplabxc/

Edited by Modena 2014-06-12
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3167
Posted: 04:20am 11 Jun 2014
Copy link to clipboard 
Print this post

Yes, you need the pro version to recompile the source and squeeze MMBasic into the PIC32MX150.

Geoff
Geoff Graham - http://geoffg.net
 
Modena
Newbie

Joined: 07/06/2014
Location: Australia
Posts: 10
Posted: 02:28pm 11 Jun 2014
Copy link to clipboard 
Print this post

ah ok, expensive, but I note that the free version can enable a 60 day full pro unlock, yippee!
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024