PICAXE serial

From ShawnReevesWiki
Revision as of 16:07, 1 March 2014 by Shawn (talk | contribs) (Created page with "==Connecting PICAXE to computer== ===Inverting serial logic=== One difficulty in integrating PICAXE into your lab is that its serial device is inverted from the normal TTL log...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Connecting PICAXE to computer

Inverting serial logic

One difficulty in integrating PICAXE into your lab is that its serial device is inverted from the normal TTL logic, so that it can be programmed cheaply via a standard, 15V RS-232 port with resistors to bring the signal's voltage to 5V. You may use other serial devices that use standard TTL logic to communicate to a computer via a TTL<>RS232 or TTL<>USB circuit, but you'll have to use one of the following solutions to make sure the logic is the proper flavor.

Alter firmware of FTDI chip

You can use a Windows computer to reprogram an FTDI USB<>TTL chip to invert the logic properly, after which you can use the chip with any OS, including MAC. See http://www.ftdichip.com/Support/Documents/AppNotes/AN_124_User_Guide_For_FT_PROG.pdf for instructions on how to use FTProg, FTDI's programmer. See http://letsmakerobots.com/node/19013 for specific instructions on how to switch the logic. See http://www.ftdichip.com/Support/Utilities.htm, see http://www.ftdichip.com/Support/Utilities.htm#FT_Prog for a download link to the utility. FTDI warns that using this utility may render the hardware unusable.

Use an inverter IC

You can use a logic inverter chip to switch the logic of the serial lines. See http://letsmakerobots.com/node/21245 (or http://www.patrickmccabemakes.com/PatrickMccabeMakes/FTDI.html ) for instructions.

Programmed communications can be either flavor

This is not a concern with programmed serial communications, since you can choose to invert, or not, serial communications during operation with the configuration parameter "baudmode". For example, SEROUT 2, N2400_4(b1) outputs to pin 2 the value of input b1, at 2400 baud when the chip is running at 4MHz, with idle (logical 0) low; SEROUT 2, T2400_4(b1) would do just the same but with idle high, a low voltage indicating a logical 1. T stands for TRUE, the standard mode most systems such as Arduino use.