Hi Everyone,
I wanted to experiment with I2C, so I bought an I2C driver for a standard 1602 LCD
http://www.ebay.com/itm/261210115256?ss ... 4098wt_932
They say master address is 0x27...That's all I know.
I have absolutely no clue on where to start.... I'm planning on using it with an Atmel CPU ( have some ATTINY2313, or ATTINY4313 or ATTINY44A or ATTINY861V or ATTINY48 or ATTINY28V)
Can someone provide me an example ? I just need to display any message: I can figure out the rest !
Thanks !
L'exemple peut etre en francais aussi !
getting started with I2C
Moderator: Benj
-
- Flowcode v5 User
- Posts: 63
- Joined: Fri Apr 19, 2013 2:18 am
- Has thanked: 10 times
- Been thanked: 14 times
- Contact:
Re: getting started with I2C
I would be interested in this as well. But I would like to use a PIC chip like the PIC16F88 etc.
-
- Posts: 1314
- Joined: Sun Jan 15, 2012 3:15 pm
- Has thanked: 474 times
- Been thanked: 458 times
- Contact:
Re: getting started with I2C
Hi Alberta
If you do a search on here for i2c lcd, there are a few examples there was a recent thread on it, might be worth starting with those posts
Regards
Dazz
If you do a search on here for i2c lcd, there are a few examples there was a recent thread on it, might be worth starting with those posts
Regards
Dazz
To sign up to the V5 forum follow this link http://www.matrixmultimedia.com/forum_upgrades.php
-
- Flowcode v5 User
- Posts: 63
- Joined: Fri Apr 19, 2013 2:18 am
- Has thanked: 10 times
- Been thanked: 14 times
- Contact:
Re: getting started with I2C
Hi (again) Dazz,
Prior to post, I looked at the following:
http://www.matrixmultimedia.com/mmforum ... i2c#p48562
It is very, very simple....but .....
It was originally made for a PIC, but I'm guessing , that once converted to AVR, the principle should be the same with AVR. I could not figure out how it works....
- Where is the slave address set ? could not find any where, where an address is entered...
- The LCD is configured to use a bunch of port... I would have expect no port to be configured for the LCD, as it should communicate via I2C ?!?!
As I mentioned, I'm totally new with I2C....I would have expected a communication macro command, that would specify the destination, and the data to be sent .... Didn't see anything close ....
Is it possible that some code was lost when imported as an AVR project ?
Regards,
Jasmin
Prior to post, I looked at the following:
http://www.matrixmultimedia.com/mmforum ... i2c#p48562
It is very, very simple....but .....
It was originally made for a PIC, but I'm guessing , that once converted to AVR, the principle should be the same with AVR. I could not figure out how it works....
- Where is the slave address set ? could not find any where, where an address is entered...
- The LCD is configured to use a bunch of port... I would have expect no port to be configured for the LCD, as it should communicate via I2C ?!?!
As I mentioned, I'm totally new with I2C....I would have expected a communication macro command, that would specify the destination, and the data to be sent .... Didn't see anything close ....
Is it possible that some code was lost when imported as an AVR project ?
Regards,
Jasmin
-
- Posts: 1314
- Joined: Sun Jan 15, 2012 3:15 pm
- Has thanked: 474 times
- Been thanked: 458 times
- Contact:
Re: getting started with I2C
HI Jasmin
The I2c components are added into the code in that fcf, open the flowchart in that thread, right click the lcd component in the panel, select custom code, then when the code box opens select the start and click edit code, you will see the i2c code added for the start of the lcd, check all the other macros, make a note of the i2c stuff then add your slave address where needed etc, i'm not too clever with i2c, but if you read through as i suggested you should be able to pick it up, there are other examples, but the basics will be the same, i've also attached an i2c spec pdf ,it may pay to read through it
Regards
Dazz
The I2c components are added into the code in that fcf, open the flowchart in that thread, right click the lcd component in the panel, select custom code, then when the code box opens select the start and click edit code, you will see the i2c code added for the start of the lcd, check all the other macros, make a note of the i2c stuff then add your slave address where needed etc, i'm not too clever with i2c, but if you read through as i suggested you should be able to pick it up, there are other examples, but the basics will be the same, i've also attached an i2c spec pdf ,it may pay to read through it
Regards
Dazz
- Attachments
-
- I2c spec.pdf
- (1.31 MiB) Downloaded 382 times
To sign up to the V5 forum follow this link http://www.matrixmultimedia.com/forum_upgrades.php
- Mantas
- Posts: 221
- Joined: Tue May 15, 2012 10:32 pm
- Location: Klaipeda, Lithuania - North sea, UK
- Has thanked: 57 times
- Been thanked: 27 times
- Contact:
Re: getting started with I2C
Hi,
here are some sample macros that I made and use very often:
Hope it helps.
BR,
Mantas
here are some sample macros that I made and use very often:
Hope it helps.
BR,
Mantas
Science is my true religion.
-
- Flowcode v5 User
- Posts: 63
- Joined: Fri Apr 19, 2013 2:18 am
- Has thanked: 10 times
- Been thanked: 14 times
- Contact:
Re: getting started with I2C
Mantas:
Finally got back from work site. I wanted to try your example, but I could not open them.
My guess is that the .FCM extension, is for the "full blown Microchip version" of Flowcode... Can you confirm ?
If it's the case, that might explain why I could not open it: my version is for the Atmel(AVR) family ....
To Everyone:
Any volunteer to write a quick example of I2C writing to an LCD (address 27) ??
Thanks everyone (and you too Mantas !!)
Jasmin
Finally got back from work site. I wanted to try your example, but I could not open them.
My guess is that the .FCM extension, is for the "full blown Microchip version" of Flowcode... Can you confirm ?
If it's the case, that might explain why I could not open it: my version is for the Atmel(AVR) family ....
To Everyone:
Any volunteer to write a quick example of I2C writing to an LCD (address 27) ??
Thanks everyone (and you too Mantas !!)
Jasmin
-
- Valued Contributor
- Posts: 2045
- Joined: Wed Aug 27, 2008 10:31 pm
- Location: Netherlands
- Has thanked: 553 times
- Been thanked: 1081 times
- Contact:
Re: getting started with I2C
FCM is a macro. Use Macro Import to include it into your flow chart.
“Integrity is doing the right thing, even when no one is watching.”
― C.S. Lewis
― C.S. Lewis