![]() |
Forum Index : Microcontroller and PC projects : Changing Micromite pinout?
Author | Message | ||||
Modena Newbie ![]() Joined: 07/06/2014 Location: AustraliaPosts: 10 |
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 ZealandPosts: 9489 |
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: AustraliaPosts: 3269 |
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 ZealandPosts: 9489 |
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 ZealandPosts: 2400 |
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: AustraliaPosts: 10 |
thanks Geoff, that's great info. I will check it out. robert: nice idea, that would be even better. |
||||
MicroBlocks![]() Guru ![]() Joined: 12/05/2012 Location: ThailandPosts: 2209 |
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. Microblocks. Build with logic. |
||||
Geoffg![]() Guru ![]() Joined: 06/06/2011 Location: AustraliaPosts: 3269 |
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. 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: ThailandPosts: 2209 |
Sittin' on the dock of the bay, watching the tide roll away.....ooh Microblocks. Build with logic. |
||||
Modena Newbie ![]() Joined: 07/06/2014 Location: AustraliaPosts: 10 |
Geoff, are you referring to these compilers? http://www.microchip.com/pagehandler/en_us/devtools/mplabxc/ |
||||
Geoffg![]() Guru ![]() Joined: 06/06/2011 Location: AustraliaPosts: 3269 |
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: AustraliaPosts: 10 |
ah ok, expensive, but I note that the free version can enable a 60 day full pro unlock, yippee! |
||||
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |