Page 1 of 1

Flowcode V6.1.2 PIC24FV32KA304 I2C not working

Posted: Sun Feb 21, 2016 7:32 pm
by Jörg Güldner
Hello,
I need urgent help for a project with PIC24FV32KA304. The controller writes and reads datas to an fram. The connection are made over I2C. In the attachment is a little programm and I get it not running.
The I2C master1 component is used and additional port pin as a sync signal for oscilloscop. With this programm, there are no sync signals and no signals on the clock and data from the I2C.
The program seems to be hung up? When I switch over the I2C from channel1 to software mode, the sync signals are coming, but no I2C signals ?
Advice: the fram address are 11 bits. 3 of them are pages and inside the device ID. So I could not use "write byte transaction" because there are two address bytes.

I try the programm with another chip (PIC24FV16KA301) and there happens the same again. Switching over to software channel on pin B8 is no signal. I changed then B8 to B2 and the clock signal is present???
I installed the update to V6.1.3 --> the same situation

With the PIC24FV32KA304: Switch over software I2C to Pin C8 and C9 --> nothing happens --> switch over to A7 and B10 --> signals coming ??? But every second loop reading is not correct (Have alook to the PDF).

Can anyone have a look to this situation?

Thanks in advanced
Jörg

Re: Flowcode V6.1.2 PIC24FV32KA304 I2C not working

Posted: Thu Mar 03, 2016 5:25 pm
by LeighM
Should the 0xa1 in fram_write be a 0xa0?

Re: Flowcode V6.1.2 PIC24FV32KA304 I2C not working

Posted: Fri Mar 04, 2016 8:12 pm
by Jörg Güldner
Hello LIghtM,
to write to fram is a "0", read a "1". May be that by all my trials this was changed. But the importand point is, that there are no signals coming out from the I2C engine.
The software I2C is although not running on the pins b8/b9. My project must be ready in the last days and so I wrote over the weekend a bit banging I2C software for
this pins (Boards are produced and already placed with components). My project is now running.

But is was very good, to use the I2C engine with the flowcode component.
If you found something, why it`s not working, I can test.

Best regards
Jörg

Re: Flowcode V6.1.2 PIC24FV32KA304 I2C not working

Posted: Tue Mar 08, 2016 9:41 am
by LeighM
Glad you got it running (bit bang).
I've ordered some chips to check the operation of the Flowcode V6 component with hardware I2C

Re: Flowcode V6.1.2 PIC24FV32KA304 I2C not working

Posted: Wed Mar 16, 2016 12:39 pm
by LeighM
Hi Jörg

As promised, I've just tested the Flowcode I2C component with hardware channel 1 on a 24F16KA102 and 24FV32KA302 and it all works OK,
(not tested with your particular FRAM though), so not sure what the issue was, but glad your project is now running.

Regards,
Leigh
i2c.jpg
i2c.jpg (59.26 KiB) Viewed 19565 times

Re: Flowcode V6.1.2 PIC24FV32KA304 I2C not working

Posted: Wed Mar 23, 2016 7:31 pm
by Jörg Güldner
Hello LeighM,
this is what I´m missing. In the attached filename, you can see the controller I used for test. Status is, that it`s not running in my case. In the PDF is the hardware shown with pullups and I2C connected to the
dedicated pins. The little programm toogles a bit to see, if the cpu is working. On clock out is a frequency of 4MHz. But no signals on B8/9? Switching over to software I2C is also not running.
So is there a mistake in setting up something? Can you send me your program to check it here?.


Best regards
Jörg

Re: Flowcode V6.1.2 PIC24FV32KA304 I2C not working

Posted: Thu Mar 24, 2016 9:52 am
by LeighM
Hi Jörg

You need to add a call to the I2C Start macro before the TransmitByte, and then a Stop afterwards.

Have a look at the datasheet for your FRAM, you will most likely need something like:

Start, TransmitByte, ... Restart, ..., ReceiveByte, Stop

Leigh

Re: Flowcode V6.1.2 PIC24FV32KA304 I2C not working

Posted: Sun Apr 10, 2016 5:59 pm
by Jörg Güldner
Hello!
I noticed already, to send only 1 byte is not working. The set with start, byte ,restart,byte...., stop is running.
I tested this on a PIC24FV16KA301. If you switch over from channel1 to software, the pins b8,b9 are not working. Why?

I altough replace my own software I2C in my project on pin b8,b9 with the flowcode I2C component and try the program again. It`s not working!
There are coming out some datas, but I´ve not time enough in the moment to look on to this problem.
The program is using 2 x SPI, 1 x UART and 1 x I2C. May be, that there is a collision anywhere, I don`t know.

Best regards
Jörg