-
Programming Jig
08/19/2014 at 08:21 • 0 commentsAssembled the programming jig this evening. On the downside, noticed a few missing routes on the boards I made. Oh well ... just learning Eagle so bound to be a few errors. Thankfully nothing vital for my tests.
-
OSHPark delivers!
08/18/2014 at 22:30 • 0 commentsPrototype boards arrived today! And, miracle of miracles, the edge connector tabs line up as I'd planned (but had to guess a fair bit). These tabs are for the initial BlueBasic flash image. Planning to do update OTA.
-
I2C and complex wire protocols
08/18/2014 at 20:19 • 0 commentsOne thing I always felt the Arduino made a bit "manual" was writing the various wire protocols you need to talk to common devices. There are various one-wire protocols out there for different sensors (e.g. temperature sensors like the DHT-22) and, consequentially, you have to hunt around to find a good library to talk to them, or write one yourself. While I cannot possibly include a library for every protocol, I decided to add a better way to construct a wire protocol.
So I added the "WIRE" command to Blue Basic. Essentially this allows a set of command to be written to read, write, pause, sample, and generally manipulate one of more chip pins. This makes it much simpler to write a complex protocol. For example, to read the state of the DHT-22 temperature/humidity sensor, the WIRE protocol looks like this:
WIRE P0(0) OUTPUT HIGH, LOW, WAIT 1000, INPUT PULLUP PULSE B, OUTPUT HIGH
This line outputs a 1000us start pulse to the device attached to P0_0, and then reads back the sequence of pulses from the device info the array B. B can then we reassembled into the temperature value.
As a side effect of this, I also added an I2C command (i2c is not provided natively on the CC2540) which internally uses the WIRE protocol.