Sparkler. GPL licensed free
software. EXPERIMENTAL!
Quickie instructions
The FireCracker dongle (CM17A) monitors DTR & RTS to accept 40 bit commands.
The protocol can be found here:
http://www.x10.com/manuals/cm17a_proto.txt
However since the PalmPilot doesn't have a programmable DTR line I had to use
the TXD line in its place. So in order to hook the CM17A to a PalmPilot you
will have to connect the PalmPilot's TXD line in place of the DTR line going to
the CM17A. Leave the DTR line unconnected.. such that you only have GND, TXD
(going to where DTR is supposed to be), and RTS going to the CM17A. Do NOT
attempt to utilize the CM17A as a pass-thru in this configuration because I
presume it would not work.
About this sparkler software; I wasn't able to find a suitable means to
manipulate the TXD & RTS lines by using the API. So I had to go directly to
the Dragonball registers. This makes the code non-portable.
I am not that experienced in programming the Dragonball registers. After a
helping hand from Oliver King-Smith who sent me the code to clear/set the RTS
line, I was able to figure out how to do the same to the TXD line. From my
understanding of the Dragonball documentation there are three memory mapped
bytes that are used to control each port; select, dir, and data. Actually
there is a fourth, pullup-enable, which controls whether or not pullup
resistors are enabled on the port.
The select register is used to change whether a port (or certain bits of a
port) are connected to internal peripherals, or if it is just a general purpose
I/O pin. The dir register controls whether it is an input or output pin. And
the data pin is used to read/write bits to the port.
Anyhow, that's as much as I know.. and it was all I needed to know. Basically
the TXD and RTS lines are normally connected to the UART (select register bits
are 0). With the select register however we choose to make them into general
purpose I/O pins and we can then set them high or low at will.
/* detach RTS from UART and make it into a GP I/O */
SET_BIT(pRegisters->portMSelect, UART_RTS_LINE);
To make the pins into latching output pins, we just use the dir register.
/* set RTS to be an output */
SET_BIT(pRegisters->portMDir, UART_RTS_LINE);
Then to set the pin high or low you just use the data register. Most models of
the PalmPilot have an inverting tranceiver, although I think there are some
models that don't. I'll have to check for that later on I guess.
/* make the pin high */
CLEAR_BIT(pRegisters->portMData, UART_RTS_LINE);
/* make the pin low */
SET_BIT(pRegisters->portMData, UART_RTS_LINE);
The same thing is done with TXD, you just look in the Dragonball manual and
find the appropriate port and bit that goes along with the function you need.
Although I think the pin names on the chip will tell you.
When you are all done, just reconnect the pins to the UART by using the select
register.
/* set RTS back to normal */
CLEAR_BIT(pRegisters->portMSelect, UART_RTS_LINE);
/* set TXD back to normal */
CLEAR_BIT(pRegisters->portGSelect, UART_TXD_LINE);
I don't think this stuff is the same on the Dragonball EZ so I'll have to add
some testing etc to make it work. Likewise if there are models with
non-inverting tranceivers.
Update:
- V0.03 - Awesome changes from Chris Hawks. I did leave out the
PalmOS 3.5 SDK changes because I still use SDK 2.0 - whatever is in the
Debian stable tree.
- V0.02 - Added support for EZ processor.
- V0.01 - Still playing around. This is experimental software and it
manipulates the Dragonball registers. It is probably not compatible with the
Dragonball EZ processor.
Feedback:
Chris Faherty
<rallymonkey@bellsouth.net>
|