I2C LCD on Crow Pi

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 8.

Moderator: Benj

Post Reply
peterhalloway
Posts: 30
Joined: Sat Dec 29, 2012 4:49 pm
Has thanked: 9 times
Been thanked: 5 times

I2C LCD on Crow Pi

Post by peterhalloway »

Hi All
I am hoping one of you seasoned programmers can help. I have dabbled with Flowcode over a number of years, previously with PIC's. I recently purchased a raspberry PI development kit called Crow Pi (link below) I also purchased a new flowcode licence so I could try it with the Raspberry Pi. I have slowly been working through the many sensors on the board to test them with flowcode. I have had success until I got to the I2C devices. The first one being a 16x2 LCD on address 0x21. The simple attached code doesn't work and I have also noticed that when I then try and run the example python code provided that does not work until I reboot. I also notice that Putty only briefly comes up then closes, normally it stays open.

I want to get the I2C devices working before I move on to the SPI devices (another new area for me.)

Could anyone please let me know what I am doing wrong.

Pete
Attachments
CrowPi_User_Manual.pdf
(3.57 MiB) Downloaded 252 times
LCD.fcfx
(8 KiB) Downloaded 228 times

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: I2C LCD on Crow Pi

Post by Benj »

Hi Pete,

You might want to try the software I2C channel and hopefully that will work ok.
props.jpg
props.jpg (33.85 KiB) Viewed 7014 times
Looks like the hardware channel is currently unsupported.

Your program doesn't have a loop and this could be why putty is closing. It closes when the program terminates I beleive.

SPI should be ok but could also be troublesome. Leigh is your man for this but he's off at the moment. Software is there too as a fall back should you need it.

Let us know how you're getting on.

peterhalloway
Posts: 30
Joined: Sat Dec 29, 2012 4:49 pm
Has thanked: 9 times
Been thanked: 5 times

Re: I2C LCD on Crow Pi

Post by peterhalloway »

Hi Ben
thanks for your reply. I have added a loop and set the channel to software. This give me the most hopeful result which is the two status LED's pulsing for the data and clock lines but nothing on the display still.

Pete
Attachments
LCD.fcfx
(8.42 KiB) Downloaded 279 times

peterhalloway
Posts: 30
Joined: Sat Dec 29, 2012 4:49 pm
Has thanked: 9 times
Been thanked: 5 times

Re: I2C LCD on Crow Pi

Post by peterhalloway »

Hi Benj
any further help on this please the wider community don't seem to be coming forward with anything

Thanks

Pete

kersing
Valued Contributor
Valued Contributor
Posts: 2045
Joined: Wed Aug 27, 2008 10:31 pm
Location: Netherlands
Has thanked: 553 times
Been thanked: 1081 times

Re: I2C LCD on Crow Pi

Post by kersing »

peterhalloway wrote: any further help on this please the wider community don't seem to be coming forward with anything
Didn’t know we were obligated to help you out, but feel free to send me a kit and I’ll take a look at your issue...
“Integrity is doing the right thing, even when no one is watching.”

― C.S. Lewis

peterhalloway
Posts: 30
Joined: Sat Dec 29, 2012 4:49 pm
Has thanked: 9 times
Been thanked: 5 times

Re: I2C LCD on Crow Pi

Post by peterhalloway »

Hi Apologies my post came across in the wrong way. This is a very good forum with many very experienced Flowcode users that are always offering great assistance.

As no-one had answered my post (which is unusual) I assumed that people did not know the answer so I thought I would go back to BenJ. I also know that Ben is busy at home looking after his little one. I should have PM'd him, so apologies again if I offended you or anyone else it certainly wasn't my intention.

I took delivery of an I2C LCD today and hooked it up to a Pi zero and it worked straight away so there is clearly something going on with the hardware of the CrowPi. I have asked the manufacurers but off course they are coming back with they are not familiar with Flowcode. So I'm stuck in a loop!

Pete

mnf
Valued Contributor
Valued Contributor
Posts: 1208
Joined: Wed May 31, 2017 11:57 am
Has thanked: 70 times
Been thanked: 440 times

Re: I2C LCD on Crow Pi

Post by mnf »

I'm certainly not familiar with the crow Pi - of you have access to a logic analyser (if not you can get them from banggood for £5.99) - you could take a look at the output of the i2c pins. Could be many reasons it's not working!

Martin

medelec35
Matrix Staff
Posts: 9521
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times

Re: I2C LCD on Crow Pi

Post by medelec35 »

Hi Pete,
can you please make sure1 second flash test is working OK?
Need to make sure clock speed is correct before checking code etc.
In fact you could kill two birds with one stone and check both pins used for the LCD.
Martin

peterhalloway
Posts: 30
Joined: Sat Dec 29, 2012 4:49 pm
Has thanked: 9 times
Been thanked: 5 times

Re: I2C LCD on Crow Pi

Post by peterhalloway »

Hi Martin
I sent the 1 second flasher to both I2C pins G2 and G3 on the Pi and the status LED's are flashing as expected.

The driver is an MCP23008 I don't know if there is anything odd about this that Flowcode is not catering for?

http://ww1.microchip.com/downloads/en/D ... 01919F.pdf

Thanks for the suggestion any help is gratefully received.

Also the other Martin (MNF) I don't think I have a logic analyser but I do have a scope.

Pete

mnf
Valued Contributor
Valued Contributor
Posts: 1208
Joined: Wed May 31, 2017 11:57 am
Has thanked: 70 times
Been thanked: 440 times

Re: I2C LCD on Crow Pi

Post by mnf »

Some sample traces for i2c in this topic. https://matrixtsl.com/mmforums/viewtopi ... 63&t=22040 - fotios used a scope and those I show use the logic analyser of a smartscope...

Martin

Post Reply