Timer for PIC16

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?

Load Previous Replies
  • up

    Kenny Kim

    ^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?

    • up

      Kenny Kim

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

       

      • up

        Kenny Kim

        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