PIC16 people - how are you going about timing your code? The timers build in... can they go to 90 second? Right now it seems easier to try and get the RTC to work and just subtract values from there... opinions?

Views: 328

Reply to This

Replies to This Discussion

For now, I'm using RTC for the process and the built in timers for smaller things like motors. Havent implemented RTC subtractor (rollover seems to be worrysome/potentially annoying)

How do you convert the difference (from the RTC values subtraction) from binary to ascii?

'm using timer0 overflow interrupts. You need to use the prescalers and count how many times the timer overflowed. I looked at this:http://microautomate.com/pic/timing-timers/

 

^I have been looking at that, but the interrupt code isn't working for me (I literally copy and pasted...). Did you have to change anything, if yes, what?

 I wrote my own code, just looked at that website for concepts and the numbers - but idk my timer is slow.

 

I'm using RTC and just subtracting minutes and seconds value before and after, it works as long as the hour value doesn't change during the operation, which is a good assumption most of the time, to answer remo's question, you convert it to BCD digits and adding 0x30 to each digit converts then to ASCII, since 0x30 is the value for "0", or you can define a table with "0123446789" and use each BCD digit as table index to return the ASCII values

RSS

© 2024   Created by PML.   Powered by

Badges  |  Report an Issue  |  Terms of Service