TRANSFORMER COIL WINDING COUNTER WITH TMR1 AS COUNTER

mikroC AI for PIC is a full-featured ANSI C compiler available on Windows, Linux, and macOS. Within advanced meMake build system speed up your builds with parallel jobs and build only the necessary to make most of your CPU and thus decrease the compile and linking times.
Post Reply
Author
Message
DerrickPro
Posts: 1
Joined: 21 May 2023 00:35

TRANSFORMER COIL WINDING COUNTER WITH TMR1 AS COUNTER

#1 Post by DerrickPro » 21 May 2023 01:20

I dont know if there is a bug or its me making a mistake, if you look at the while(1) loop, the first 14 lines are ment to work in the way that if PulseCounter matches counter reference (RefCOUNTER), TMR1 is stoped and the turns are displayed on the 3 digit 7seg,and Relay is turned on and enter into a loop which is only exited when the ENTER button is pressed and counter cleared to prepare for the next count with the same counter reference in my case 1000 turns. I have set PulseCount = 997 by initially set TMR1H = 3, TMR1L = 229, i have done this sothat i can easly reach 1000 turns when i press the megnetic (Reed) button to see how the first 14 lines in the main while(1) loop execute,tocount starting from zero just set TMR1H =0, and TMR1L = 0 initially but to my suprise it just jumps out off this loop without even pressing the ENTER button i think this is not correct.Even other lines dont work as they are supposed to work. Am going to upload my code and protues

Post Reply

Return to “mikroC AI for PIC”