Shop
OBEX
P1 Docs
P2 Docs
Learn
Events
I2C bus timing on BOE & propgcc — Parallax Forums
toggle menu
Categories
Discussions
Sign In
·
Register
Sign In
·
Register
Categories
Discussions
Sign In
·
Register
×
Home
›
Learn with BlocklyProp
I2C bus timing on BOE & propgcc
jimmy_boy
Posts:
2
2012-12-04 11:27
edited 2012-12-07 20:10
in
Learn with BlocklyProp
Hi All. How is the bus timing achived on I2C bus when using the i2c drivers with propgcc?
Comments
SRLM
Posts:
5,045
2012-12-04 12:25
edited 2012-12-04 12:25
Hi Jimmy Boy, welcome to the forums.
It looks like PropGCC I2C driver is i2c_driver.c, located in /lib/sys/propeller/i2c_driver.c:
https://code.google.com/searchframe#1rh7kcLST58/demos/propboe/libsrc/i2c_driver.c
Or, at least that's one of them. It's all C code, compiled down to a cog image. To answer your specific question: it uses waitcnt.
There is also /lib/sys/propeller/i2c_simple.c, which is not cog based (ie, *MM):
https://code.google.com/searchframe#1rh7kcLST58/lib/sys/propeller/i2c_simple.c
i2c_simple.c seems to just run as fast as possible, without any timing. This seems a bit awkward, since some I2C devices might not be able to operate as fast as the Propeller runs that code (not to mention the timing jitters).
jimmy_boy
Posts:
2
2012-12-07 20:10
edited 2012-12-07 20:10
SRLM- thanks for this pointer. Counld'nt get any of the C code running on my prop BOE i2c bus, so Im going back to spin. Have a great day!
Sign In
or
Register
to comment.
Comments
It looks like PropGCC I2C driver is i2c_driver.c, located in /lib/sys/propeller/i2c_driver.c: https://code.google.com/searchframe#1rh7kcLST58/demos/propboe/libsrc/i2c_driver.c
Or, at least that's one of them. It's all C code, compiled down to a cog image. To answer your specific question: it uses waitcnt.
There is also /lib/sys/propeller/i2c_simple.c, which is not cog based (ie, *MM): https://code.google.com/searchframe#1rh7kcLST58/lib/sys/propeller/i2c_simple.c
i2c_simple.c seems to just run as fast as possible, without any timing. This seems a bit awkward, since some I2C devices might not be able to operate as fast as the Propeller runs that code (not to mention the timing jitters).