I believe my answer lies in the I2CMasterSendStart function. I had experimented with it before but I'm getting more sensible results now.
Still, if anyone has a good solution to this I'm listening!
George, give the attached project a try. Use PuTTY @9600bd to display the results. Project probably needs selection of your PSoC chip, this is for a PSoC4-M.
I2CScan.cyprj_.Archive01.zip 25.2 K
Hi Bob, thanks!
I changed the I2C and UART components as they were not compatible with my device, I left all as default apart from I2C changed to Multi-Master-Slave. I'm using a different UART terminal (Termite @ 115.2 kbps) but that shouldn't matter, right?
The code runs as expected until is reaches address 8. At this point the programs hangs at I2C_I2CMasterSendStart. I added a few debugging lines to see what was going on, here's the output:
[0C]Scanning I2C Addresses...
Sending Start (Address: 0)
Sending Start (Address: 1)
Sending Start (Address: 7)
Sending Start (Address: 8)
I've tried slave addresses 0x10 and 0x14 but no difference. The I2C bus should work, hardware wise, as I've had other I2C test programs running just fine, it's just two pioneer kits linked together with 4k7 pullups on SDA & SCL.
Address 8 "smells" like a PSoC slave's default address.
Where does the program exactly stop? compile the project with optimization set to "None" and when it hangs, press the halt button and see where in I2C.c it waits for whatever.
while(!I2C_CHECK_INTR_MASTER(I2C_INTR_MASTER_I2C_ACK | ......
Something weird going on.. It all looked clear with the logic analyser but I'll check with the scope.
Using the code I've been playing with, which is essentially the same, the results are the same. If I start the scan at address 9 it works great.
Something about address 8 then. Hey I've got it. that's module's own flippin' address! I forgot to add the "ignore your own address, dummy" line.
This highlighted that I2CSlaveSetAddress function wasn't working.
For anyone reading this and having issues with this function, ensure it is called after I2C_Start.
I have now tested the Bob's I2CScan and for DS1307 on the CY8CKIT-042 .... it works as expected.
The 7 bit right justified DS1307 address is scanned as 0x68 which is OK.
I am at my wit's end. I have been slaving away trying to get this Pioneer BLE board to talk to this SI7021 sensor. I stumbled across this i2c scanner and thought that my problems would be solved (or at least I would move forward). I run this code and get nothing. The address is supposed to be 0x40. This code runs and never returns anything. The serial port works as it says 'Scanning I2C Addresses". I am connected to the pins labeled 3v3 and ground and SDA on the chip is connected to P3.4 and SCL is connected to P3.5 (for the i2c bus). When I put this sensor on a teensy 3.0 and run the ADAfruit code, I get temperature and humidity. Works like a champ. Connect it to a Pioneer board and nothing. I have tried using the i2cmasterWrite/ReadByte commands to be similar to the arduino wire.write (in a different project) and I cannot get it to talk. That is why I ended up here. I get no response. Can you point out what I am doing wrong? This bus scan code does not 'see' the sensor. (when I put this sensor on the board and load the BLE beacon code, it reports temp and humidity via bluetooth just like a beacon, so I feel it must be code and not hardware)
I2CScan.cyprj_.Archive01_2.zip 624.1 K
Did you configure your Pioneer kit to run at 3.3V using the jumper at J16?
Yes, the jumper is set at 3v3. I was able to finally get i2cmasterreadbuff working to read my sensor (Si7021) in the project I was working on. If I run this code on my CY8KIT-042-BLE, I get nothing.