Im using the xem 3005 board to control a microcontroller (pic16F874, by Microchip). Im very glad to know that there’re i2c read and write functions and tested them. However, I always get a “Nack” error when i try to write the mcu - the address is sent but not the data. Testing the mcu i2c using two mcu’s, i see that clock signal (SCL) is about 30khz (fpga’s SCL clock is about 300khz) and the i2c link works fine.
I dont think it’s a frequency problem because 16F874 supports SCL up to 400khz.
So, i have a few questions, please:
Do I need to load some .bit file in fpga before using the i2c? Im asking because I dont load anything and it still sends the i2c signal through the pins. I’m concerned that if I dont load anything, the SCL ans SDA pins ‘high z’ constraints will not work, making the fpga blind to any Acknowlege signal from mcu.
I’m using Matlab (on dll available) and the data parameter type is unsigned char. The matlab uint8 type work well? (ex: data= uint8([1 1 0 0 1 0 1 0]), for only one byte to send.
Thank you very much,