D
Don
Guest
Lasse Langwadt Christensen wrote:
> skrev Don:
<snip>
You need to generate and interpret signals with nano second timing to
use i2c. Here\'s a power-on code snippet from my App:
/* Initialize when power supply conditions are not met: */
nSleep (15000000L); /* Wait 15 ms, 15000000 ns */
iicWrite(0x00); /* RS=Instruction; RW=Write; */
nSleep (40L); /* Wait 40 ns */
iicWrite(0x34); /* E; DB5=Function Set; DB4=8-bit */
nSleep (230L); /* Wait 230 ns */
Danke,
--
Don, KB7RPU, https://www.qsl.net/kb7rpu
There was a young lady named Bright Whose speed was far faster than light;
She set out one day In a relative way And returned on the previous night.
> skrev Don:
<snip>
Did you overlooked the iic part of my original followup up there? ^^^
My RPi Apps use nanosleep to react to and time external Inter-Integrated
Circuit signals. ...
OK, maybe you\'re supposed to say i2c instead of iic.
you are generating signals, not reacting and measuring. That easy you just burn cycles while waiting
and iic will work just fine with milli second timing ...
How is nanosleep going to help if you want to time when and for how long and
You need to generate and interpret signals with nano second timing to
use i2c. Here\'s a power-on code snippet from my App:
/* Initialize when power supply conditions are not met: */
nSleep (15000000L); /* Wait 15 ms, 15000000 ns */
iicWrite(0x00); /* RS=Instruction; RW=Write; */
nSleep (40L); /* Wait 40 ns */
iicWrite(0x34); /* E; DB5=Function Set; DB4=8-bit */
nSleep (230L); /* Wait 230 ns */
Danke,
--
Don, KB7RPU, https://www.qsl.net/kb7rpu
There was a young lady named Bright Whose speed was far faster than light;
She set out one day In a relative way And returned on the previous night.