Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
I think the code is OK.
start
bsf STATUS,RP0 ; Set tmr0 as counter
movlw b'11100111' ; on rising edge with 1:255 prescaler.
movwf OPTION_REG ;
bcf TRISA,2 ; Set tmr0_pin as output.
bcf STATUS,RP0 ;
clrf TMR0
call toggletest
goto start
toggletest
movf...
It doesen't work neither with MPLAB SIM (I can only test on simulators at the moment), but it works perfectly toggling T0CS instead of T0SE. Thank you very much for the inspiration.
P.S.
I hope you can understand my english.
Bye
Pierluigi
Hi. The trick of extracting prescaler value by toggling T0SE bit til TMR0 increases seems very interesting, but it doesen't work for me. I'm testing it in Proteus VSM simulator wit a pic16f630. Do you know if it works on real-life pics. Thanks.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.