> > Hello everyone! > > How are you doing?! Iv been reading the PIC16C84 manual and Iv come up with > a few questions... Here is! > > First, about memory organization. Please tell me if Im wrong. > > - The 1K * 14 EEPROM PROGRAM memory is were my assembly program > is stored. (In binary format of course..) Yes. > > - In the DATA Memory, there is: > > - The 36 * 8 General Purpose RAM (GPR) > - And the 64 * 8 EEPROM DATA memory, what is it used for? The enigmatic "anything you want." You can sotre calibration data. Antti from Silicon Studios uses it to hold tokens in his 1/4 Stamp and demo ARTI projects. Logging data is a possibility. That EEPROM is permanent memory that the user can utilize for anything they want. > > And now for the timer0 question... It says here in section 6.1 of the > PIC16C84 documentation that the TMR0 interrupt is generated when the TMR0 > register overflows from FFh to 00h. But what the does that mean? OK what does a timer/counter do? It counts. Everytime a new event (either the internal clock or the RA4/TM0CLK pin) occurs it counts up by 1. But like every register in the PIC it's only 8 bits long. So it can only represent numbers from 0 to 255. So what happens if the TMR0 is 255 and an event occurs? Well it counts to 256 but since it can't hold 256 (which has 9 bits) it only stores the lowest 8 (as shown in the binary example below): 256: 100000000 Size: XXXXXXXX ---------------- Result:00000000 So the TMR0 register rolls back over to 0 again. This is called an overflow. Detecting an overflow is important because if you wish to monitor long delays, measure precise short delays, or monitor a specific number of counts, then you must be able to detect the overlow. So the overflow is connected to an TMR0 overflow bit that gets set to a 1 each time the timer overflows. And like all other interrupt driven bits in the PIC, it has a TMR0 interrupt enable, and the Global Interrupt Enable. So if both the TMR0 interrupt enable and the GIE are on, and an overflow occurs, then the PIC is interrupted. Be sure after detecting an overflow that you set the TMR0 overflow bit back to zero so you can detect the next overflow and get out of the interrupt ( if you decided to use it) cleanly. BAJ