Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 12:59 17 Nov 2025 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 : CMM2 Fast Count pin 18 problem

Author Message
panky

Guru

Joined: 02/10/2012
Location: Australia
Posts: 1116
Posted: 06:51am 06 Feb 2021
Copy link to clipboard 
Print this post

CMM2 Waveshare board version 5.06.00RC2

The following program works correctly when used with COUNT 4 (pin 24) but fails when using the FAST COUNT pin (18)


pwm 1,stop
setpin 18,CIN ' the fast count pin
print pin(18)
pwm 1,1000,50
pause 10
print pin(18)

>RUN
8510
8520
' the 85xx is immaterial, it just keeps increment every time the program is run
' that is, the counter is not being reset by a new SETPIN 18,CIN statement
'- the count does not even clear after a power reset!
>RUN
8530
8540

' changing to use COUNT 4 pin (24)
pwm 1,stop
setpin 24,CIN '
print pin(24)
pwm 1,1000,50
pause 10
print pin(24)

>RUN
0
10

>RUN
0
10

' works as I would expect.


Firmware is 5.06.00RC2. Also tested on an E100 running 5.05.03 using COUNT on GPIO 34 and works fine there.

Doug.

Edit: Forgot to mention - using a link from PWM to COUNT input for the tests.
Edited 2021-02-06 16:53 by panky
... almost all of the Maximites, the MicromMites, the MM Extremes, the ArmMites, the PicoMite and loving it!
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10590
Posted: 08:14am 06 Feb 2021
Copy link to clipboard 
Print this post

Try PIN(18)=0 pending a proper fix
 
Print this page


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

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025