![]() |
Forum Index : Microcontroller and PC projects : COUNT and max frequency for PicoMite?
![]() ![]() |
|||||
Author | Message | ||||
phil99![]() Guru ![]() Joined: 11/02/2018 Location: AustraliaPosts: 2611 |
If Jim's method is fast enough for your needs it will give you 10^12 counts. That is a lot! While awaiting Peter's update I think this will give 62 or 63 bits starting from 0. setpin gp0,pwm : pwm 0, 1000000,50 setpin gp6,cin > pin(gp6)= -(2^31) :pause 10000 : C=pin(gp6)+(2^31) :? C At 1MHz it will take a much longer than the 10 seconds in the above example (years I imagine) to reach 2^62. |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6269 |
53375996 days or 146236 years approximately While Peter has now given us 64 bit (signed I assume) counts, there are plenty of external devices that are 16 or 32 bit or any strange number of bits that will need converting to MMBasic integers. VK7JH MMedit |
||||
ElectroPI Newbie ![]() Joined: 27/04/2012 Location: AustraliaPosts: 37 |
Having it the same as a (signed?) integer would be great and saves confusion. Thanks Peter for including this in your next update. all the best |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10246 |
NB: The fast timer functionality is RP2350 only. This is because only the RP2350 has a second PWM interrupt and this is needed for the 16-bit PWM register rollover. The first interrupt is dedicated to audio. RC17 has the 64-bit counter variables |
||||
PhenixRising Guru ![]() Joined: 07/11/2023 Location: United KingdomPosts: 1361 |
Only just made it back to my desk to test this ![]() Many thanks Pete, works beautifully ![]() |
||||
![]() ![]() |
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |