New here, but thought I would try after not finding a solution as of yet. I have been using the Oshonsoft Basic Compiler for Pic for a number of years and have always managed to work around problems that I have had. I have gotten frustrated at times with how Vladimir has handled his dev tools but I keep reminding myself that the cost is pretty low.
I am currently trying to use a pcf8574t based LCD backpack that works just fine with Arduino boards. I am trying to get it to work with the 12f675. As I examine the data captures I have made with a Saleae Logic device, my low level commands are messed up. I cannot seem to send commands using a slave address of 0x27 which is what the pcf8574 wants. The address comes out as 0x13 and read/write depending on my sending 0x27 or 0x26. Before I resort to writing something in assembly to do this I thought I would reach out and see if anyone can shine more light on Vladimir's I2c commands. Perhaps I am doing something wrong
I have to say I have had some pretty complex pieces of code run with no issues but this has me stumped. Any ideas? Thanks in advance.
Here is what I have tried. Also changed 0x27 to 0x26 for read/write.
UPDATE: If I use an I2C slave address of 0x4e, it gets shifted in as 0x27 and works correctly. This has the feeling of a bug. Attached is a capture of what I get when sending 0x4e instead of 0x27 which is the real slave address.
Just an update . The Pcf8574 works fine using any two pins on the 12f675 (except mclr of course) and the size of the code isn't bad either. No optimization, merely parroting the .cpp code in the Arduino for that same backpack. Usable for the project I am working on. I have attached the code for a simple demo. There are sure to be some bugs and it is set for a 2 line-16 char display.
Arduino 'wire' shifts the address << 1 then somehow includes the W/R bit .. Device data sheet addresses can be either .. Wait till you get to I2C the PIC18FxxK42 series. that is fun !