HI all. I am reading the seconds register from a DS1307 RTC and using Realterm to display the values as hex.
From the data sheet the seconds should be stored as BCD as in the pic:
Now, as I understand, bits 3:0 of the seconds register will only ever be 0 to 9. Bits 7:4 will be 0 to 5, representing 10's of seconds.
I initially display the output with a simple:
where sec is the seconds.
On the terminal I see 00(hex) to 3B(hex) (0 to 59 decimal): as in the second pic
Ok, but I'm confused - if this is BCD shouldn't I see 00(hex) to 59(hex) on the terminal?
I want to set two separate port bits: One for the MS Digit and one for the LS Digit to drive a nixie display:
So for example if the seconds are 34 (dec) then PORTx.3 is set and PORTy.4 is set all others cleared.