We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
I write a simulation for this chip in the µVision2 simulation. Unfortunatly the Philips documentation for this chip is not complete. Philips also can not help me. I have some questions for the event-counter mode. Has anybody experience in this mode ?
Hi Michael, I havent used the PCF8583 as an event counter but I am currently using it as a RTC, but this is from the data sheet PCF8583_5.pdf available from the Philips web site. 7.8 Event counter mode Event counter mode is selected by bits 4 and 5 which are logic 1, 0 in the control/status register. The event counter mode is used to count pulses externally applied to the oscillator input (OSCO left open-circuit). The event counter stores up to 6 digits of data, which are stored as 6 hexadecimal values located in locations 1, 2, and 3. Thus, up to 1 million events may be recorded. An event counter alarm occurs when the event counter registers match the value programmed in locations 9, A, and B, and the event alarm is enabled (bits 4 and 5 which are logic 0, 1 in the alarm control register). In this event, the alarm flag (bit 1 of the control/status register) is set. The inverted value of this flag can be transferred to the interrupt pin (pin 7) by setting the alarm interrupt enable in the alarm control register. In this mode, the timer (location 07) increments once for every one, one-hundred, ten thousand, or 1 million events, depending on the value programmed in bits 0, 1 and 2 of the alarm control register. In all other events, the timer functions are as in the clock mode. Hopefully if you d/l the pdf you should be able to find all the info you need on how to use this chip. Mark.
Hi Mark, you will also find in chapter 7.4 (Philips PCF8583 docu) the following information: In the event-counter mode events are stored in BCD format . What is correct ??. You find in table 1 the cycle length from the clock mode. What is the cycle length in the counter mode (store in BCD format) ?? Is it allowed to use the timer and the alarm timer in the event-counter mode ?? I found no information about this point ?? How does this timer counts ??
Hi Michael, The event counter stores up to 6 digits of data which are stored as 6 hexadecimal values located in locations 1,2 and 3. thus upto 1 million events may be recorded (this is in section 7.8). For this to be true, the number MUST be in BCD format. I dont think you can use the alarm timer or timer in event count mode because the 'alarm' registers are used as the event counter alarm match and the timer register can be used to generate interrupts every 1, 100, 10000 or 1000000 events. Hope this helps, Mark. P.S. Can you not try it on 'real' H/W?
Hi Mark, thanks for your help. I write only simulation DLLs for the µVision2 simulator (see http://www.c51.de/c51.de/Dateien/uVision2DLLs.php3?Spr=EN). I don't have hardware for this functionality (signal generator, ...). Do you have an example for me to test my simulation (PCF8583 event-counter) or can you test my DLL ?? Michael