Flowcode V6.1.2 PIC24FV32KA304 I2C not working

A forums to allow bugs and problems with Flowcode v6 to be reported and resolved.

Moderator: Benj

Post Reply
Jörg Güldner
Posts: 77
Joined: Wed Jun 22, 2011 3:32 pm
Has thanked: 17 times
Been thanked: 11 times
Contact:

Flowcode V6.1.2 PIC24FV32KA304 I2C not working

Post 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
Attachments
I2C-Problem.pdf
(84.76 KiB) Downloaded 434 times
I2C_Test.fcfx
(9.04 KiB) Downloaded 361 times
Last edited by Jörg Güldner on Tue Feb 23, 2016 6:48 pm, edited 2 times in total.

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: Flowcode V6.1.2 PIC24FV32KA304 I2C not working

Post by LeighM »

Should the 0xa1 in fram_write be a 0xa0?

Jörg Güldner
Posts: 77
Joined: Wed Jun 22, 2011 3:32 pm
Has thanked: 17 times
Been thanked: 11 times
Contact:

Re: Flowcode V6.1.2 PIC24FV32KA304 I2C not working

Post 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

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: Flowcode V6.1.2 PIC24FV32KA304 I2C not working

Post 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

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: Flowcode V6.1.2 PIC24FV32KA304 I2C not working

Post 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 10225 times

Jörg Güldner
Posts: 77
Joined: Wed Jun 22, 2011 3:32 pm
Has thanked: 17 times
Been thanked: 11 times
Contact:

Re: Flowcode V6.1.2 PIC24FV32KA304 I2C not working

Post 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
Attachments
PIC24FV16KA301_Software_I2C_Test.pdf
(757.63 KiB) Downloaded 320 times
PIC24FV16KA301_Software_I2C_Test.fcfx
(5.18 KiB) Downloaded 302 times

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: Flowcode V6.1.2 PIC24FV32KA304 I2C not working

Post 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

Jörg Güldner
Posts: 77
Joined: Wed Jun 22, 2011 3:32 pm
Has thanked: 17 times
Been thanked: 11 times
Contact:

Re: Flowcode V6.1.2 PIC24FV32KA304 I2C not working

Post 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

Post Reply