Z80
Full Member level 1

i2c für z80 source
I am trying to use I2C with HI-TECH compiler v8.02 PL1
I have to connect a 24FC515 I2C EEPROM to a 16F876A. So, I am using master I2C communication.
The EEPROM is preprogrammed (it has a 8 bit PCM wave file stored in it). In my program I will only have to use sequential read, because I have to send that wave to the CCP port all at once. Anyway, since it's the first time I'm dealing practically with I2C, I guess I have a lot of learning to do. I'm familiar with I2C details but I haven't ever really used it.
I want to use 1MHz clock, and the datasheet says that the pullups have to be 2K.
I wrote my own I2C routines, using the 16F catalog, manual, and the app notes. Imagine my surprize when I found out that the PIC can't read a damn bit from the EEPROM.
So, after many hours spent banging my head against the keyboard, I thought that I might try to use the I2C examples that come with the PICC compiler. I made some manual test (read byte from that address, look on HEX file and see if its correct), and they seem to work. But, some guys on the HITECH forum say that those routines aren't working properly. How can that be? I guess that I'm doing something wrong when testing them. Well, considering that I'm very paranoid when it comes to freely available source code, I tend to believe those detractors.
Bottom line is: what I'm trying to do does not work, and since the CCP related code works fine (tested and retested it), I'm assuming that the problem comes from the I2C. And this confirmes my previous suspicion that I2C is a great source of frustration.
Now, being very low on time (it's a project that MUST be finalized in about three weeks, and the I2C part is only a minor section of it), I'm beginning to panic. The perspective of spending days trying to figure out what exacly that damn bit from register whatever does is frightening me.
I know of microchipc.com and piclist, but I really don't want to go through that the-guy-says-that-the-thing-is-tested-and-it-works-but-it-does-not experience. So if anyone can point me to something that is REALLY tested and proved to be working, you'd save extra hours of head aches.
Oh, I forgot to mention, I have to use the MSSP module, I'm not considering software I2C (yes, I know, those examples use software, but they were only for testing).
Any help would be much appreciated.
I am trying to use I2C with HI-TECH compiler v8.02 PL1
I have to connect a 24FC515 I2C EEPROM to a 16F876A. So, I am using master I2C communication.
The EEPROM is preprogrammed (it has a 8 bit PCM wave file stored in it). In my program I will only have to use sequential read, because I have to send that wave to the CCP port all at once. Anyway, since it's the first time I'm dealing practically with I2C, I guess I have a lot of learning to do. I'm familiar with I2C details but I haven't ever really used it.
I want to use 1MHz clock, and the datasheet says that the pullups have to be 2K.
I wrote my own I2C routines, using the 16F catalog, manual, and the app notes. Imagine my surprize when I found out that the PIC can't read a damn bit from the EEPROM.
So, after many hours spent banging my head against the keyboard, I thought that I might try to use the I2C examples that come with the PICC compiler. I made some manual test (read byte from that address, look on HEX file and see if its correct), and they seem to work. But, some guys on the HITECH forum say that those routines aren't working properly. How can that be? I guess that I'm doing something wrong when testing them. Well, considering that I'm very paranoid when it comes to freely available source code, I tend to believe those detractors.
Bottom line is: what I'm trying to do does not work, and since the CCP related code works fine (tested and retested it), I'm assuming that the problem comes from the I2C. And this confirmes my previous suspicion that I2C is a great source of frustration.
Now, being very low on time (it's a project that MUST be finalized in about three weeks, and the I2C part is only a minor section of it), I'm beginning to panic. The perspective of spending days trying to figure out what exacly that damn bit from register whatever does is frightening me.
I know of microchipc.com and piclist, but I really don't want to go through that the-guy-says-that-the-thing-is-tested-and-it-works-but-it-does-not experience. So if anyone can point me to something that is REALLY tested and proved to be working, you'd save extra hours of head aches.
Oh, I forgot to mention, I have to use the MSSP module, I'm not considering software I2C (yes, I know, those examples use software, but they were only for testing).
Any help would be much appreciated.