asfenlasvegas.blogg.se

Set up eon timer and ds clock
Set up eon timer and ds clock





set up eon timer and ds clock
  1. #Set up eon timer and ds clock update#
  2. #Set up eon timer and ds clock code#

For example, don't try to update the lcd in your main code, and read the rtc in an interrupt service routine.ĭo it all in one place, something like this. However, like I said earlier, make sure you read the rtc chip, then display the results in that order, from the same routine.

set up eon timer and ds clock

#Set up eon timer and ds clock code#

I see from your code that you are reading it one byte at a time, I have to assume that you handle the Not-ack, start/stop etc properly before and after calling this code to get as many data bytes as you require. If you can, use a timer with a period set for 1 sec as an interrupt source, by the time you have done your context saving etc, the rtc chip will be updated, and you can just read the rtc chip and display the result from there.Ĭheck your power supply is good first, then move on to other possible problems.Ĥ.5V is the absolute minimum that the DS1307 will run on, however should your supply dip by a smidge for any reason, the rtc chip will get upset. Or worse, reading it in the background using an interrupt, while trying to display the result in your main code body. XC822/824 Data Sheet V1.2, 2011-10 XC822/824 Data Sheet Revision History: V1.2 2011-10 Previous Versions: V1. About Press Copyright Contact us Creators Advertise Developers Terms Privacy Policy & Safety How YouTube works Test new features Press Copyright Contact us Creators. I don't know exactly how or when you are reading the rtc chip then displaying the data, but you don't want to be in the middle of reading it as it changes, The seconds being blurry is most likely a timing issue. I assume that you do have enough supply decoupling etc in your circuit, and that the power supply is good ? if the power supply to your circuit is solid the display is probably not going wacko as such, you are probably just writing junk to it during your alarm routine by accident.check that you are not changing any of the port lines going to the lcd module unintentionally. I'll leave the fine art of how you actually code that up, to you. If you check to see if the character you are sending is greater 9 in the middle of that then you can add an extra H'07' to it so that you can use the same routine to display alpha characters too Then you must unpack the BCD and add 30hex to each nibble in order to convert the raw number into ascii for the lcd.Įach byte in the table represents one set of digits (BCD)Īnd so on until you have done all the characters. For the purposes of displaying them on an lcd, you must first strip off the unused bits, because some of the registers have higher bits set for other functions, like 12/24hr mode etc, those need to be stripped off leaving you only with the actual data without any control bits. The numbers are definately stored in BCD format. I use BCD all the time with these devices.I haven't ever had a problem like that with them.







Set up eon timer and ds clock