SPIN i2c object and 6 examples (code) - Updated v1.2
All,
Attached is a SPIN project achieve that implements single a master I2C SPIN object.· I've also included six device objects and a·basic LCD (for debug) object.· The objects demo the the popular·i2c-bus and·devices:
·· -> DS1307 - real time clock
·· -> DS1621 - temperature sensor
·· -> 24LC256 - i2c serial EEPROM
·· -> (NEW v1.2) MD22 Motor Controller (http://www.robotelectronics.co.uk)
·· -> (NEW v1.2) SRF08 Ultrasonic Sensor (http://www.robotelectronics.co.uk)
·· -> (NEW v1.2) MCP23016 - i2c I/O Expander
This is provide free to Parallax Propeller users - I'll provide some support if you post to this thread.
Future development work I intend will be to add objects for the:
··· -> Multi-Master arbitration if I can find another master that implements arbration, and get my hands on a decent O-Scope!!
··· -> ASM version for speed! - when the manual is released (hint,hint)
·- so (keep) watching this space
I've fairly fully tested these libraries, but I'd appriate any feedback from you all!· If you run it multi-cog watch out for the multi-cog IO pin rules!
The device libraries are fairly light on functions and can be expanded to provide all device functions.
Questions, comments and·feedback is welcomed!
Enjoy!
James
Updated:
· version 1.1 - slight tidy up. Doc & Code.
· version 1.2 - slight tidy up. Doc & Code.· Added MD22, SRF08 and MCP23016 objects.· General improvements
Post Edited (Javalin) : 5/15/2006 8:14:58 PM GMT
Attached is a SPIN project achieve that implements single a master I2C SPIN object.· I've also included six device objects and a·basic LCD (for debug) object.· The objects demo the the popular·i2c-bus and·devices:
·· -> DS1307 - real time clock
·· -> DS1621 - temperature sensor
·· -> 24LC256 - i2c serial EEPROM
·· -> (NEW v1.2) MD22 Motor Controller (http://www.robotelectronics.co.uk)
·· -> (NEW v1.2) SRF08 Ultrasonic Sensor (http://www.robotelectronics.co.uk)
·· -> (NEW v1.2) MCP23016 - i2c I/O Expander
This is provide free to Parallax Propeller users - I'll provide some support if you post to this thread.
Future development work I intend will be to add objects for the:
··· -> Multi-Master arbitration if I can find another master that implements arbration, and get my hands on a decent O-Scope!!
··· -> ASM version for speed! - when the manual is released (hint,hint)
·- so (keep) watching this space
I've fairly fully tested these libraries, but I'd appriate any feedback from you all!· If you run it multi-cog watch out for the multi-cog IO pin rules!
The device libraries are fairly light on functions and can be expanded to provide all device functions.
Questions, comments and·feedback is welcomed!
Enjoy!
James
Updated:
· version 1.1 - slight tidy up. Doc & Code.
· version 1.2 - slight tidy up. Doc & Code.· Added MD22, SRF08 and MCP23016 objects.· General improvements
Post Edited (Javalin) : 5/15/2006 8:14:58 PM GMT
Comments
Look for my mail outside here...
-Martin
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Martin Hebel
Southern Illinois University Carbondale - Electronic Systems Technologies
Personal Links with plenty of BASIC Stamp info
StampPlot - Graphical Data Acquisition and Control
Thanks. I've been working 12+ hours a day on it since Friday! Going to work next week to sleep!
The propeller rules!
Will do.
James
Library update.
James
I2C is so useful, I'm glad someone wrote an object for it so fast.
I can't wait until I get my Propeller in the mail! This little thing seems so cool.
--Andrew "A"
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Stan Dobrowski
Here's my current setup:
A3 -> SDA w/ pullup resistor (to 3.3V)
A4 -> SCL w/ pullup resistor (to 3.3V)
I've tried to get help with this before, but i just cannot fathom what could be wrong with it. I even tried with my trusy BS2 and a similar sample program... but there just isn't any love here.
When i get home i'll get some of the code i've been using up and running... since you've been working with the MD22, i was hoping you could help at least a little.
~~Brian
Well I can try!! Have you downloaded version 1.3 of the library?
From a wireing side, you should have the MD23 powered by +5V and the SDA/SCL connected to the propeller's pins as shown for the +5V devices in the i2cDemoApp.spin
Then I suggest to prove the circuit you edit the i2cDemoApp.spin file to only run the i2cScan and edit it to output to a TV or serially to your PC etc. It should show an ACK on 0xB0 (176 decimal)
Let me know how you get on.
James