Jump to content

davence

EstablishedMember
  • Content Count

    8
  • Joined

  • Last visited

Community Reputation

0 Neutral

About davence

  • Rank
    Newbrie
  1. Thanks for that coherent advice! That makes sense now. Cheers Dave
  2. Following my answer, Dave do you have any ideas please? Thanks.
  3. I have taken the i2c example code and included it in with some code for RS232 (from and MAX7219. It uses the i2c_init and readXEE and writeXEE from the i2c example shipped with SB combined with the code from serial_test.c and some code I grabbed from the web for the 7219.
  4. There appears to be no way to test whether a read or write has been successful using the readXEE and write XEE functions in the example i2c code since the low level templatised methods do not appear to have error handling. Am I correct in this assumption, in which case how can I tell whether a write (or read) has been successful?
  5. There is no documentation about how to calculate the divisor to pass in to i2c_init. Having looked at the PIC16F877A documentation there appear to be some values mentioned, but none of these a remotely close to the 0x7E you include in the example. Please could you let me know how this divisor should be calculated. Running at 20Mhz.
  6. I have the chip's SDA and SCL lines connected to my 16F877A pins, A0-2 and WP are grounded, and I have the pull-ups in place. When I use hardware mode, my entire program fails to run, and when I use the software mode it runs, it fails to write (or fails to read) the data back from the eeprom (just returning all bytes as 0xFF). I am using a hardware code of 1010b as defined in the eeprom's notes. Do I need to configure the PortC ports myself, or is it just suffiicient to call i2c_init.
×
×
  • Create New...