Low Cost DYI "1-Wire" Serial Backpack 57600 bps

Goeytex

Senior Member
#1
While this is not technically a Picaxe project, it is provided here to give Picaxe users an inexpensive way to have a high speed serial interface from a Picaxe to a standard 16 x2 LCD display module.

If you have access to a Pic Programmer then you can make a high speed "1-wire" LED serial backpack that costs less than $5.00. The "backpack" consists of a PIC12F683, a resistor, and a capacitor. Program the PIC with the supplied code and that's all there is to it.

This little "backpack" can operate at 19200, or 57600 bps, depending upon the code flashed to the PIC. The code is assembly but a hex file is also included. Note that the diagram shows a PIC12F635, but the code is for a PIC12F683.

I did not write the code. The code was written by Mike Mclaren (K8LH) and posted in the forum below.

http://dangerousprototypes.com/forum/viewtopic.php?f=4&t=4335&p=42649#p42874

I downloaded the code, & imported the hex file into MPLABX IPE and then programmed it into a re-purposed 08M (PIC12F683). Initially there was some garbage at the beginning of the display, but that was solved by increasing the value of the cap to 1.2 nF. After the cap change, it worked fine at 57600 baud.

You may have to experiment with different capacitor values, depending upon the display. Mine was a Newhaven

The backpack firmware initializes the LCD module so all you need to do in your Picaxe code is wait about 200ms and then start sending data to the LCD. To communicate with the Backpack / LCD the Picaxe will need to use "Hserout" (True)

Picaxe Test Code:
Code:
#Picaxe 08M2
#no_data

INIT:
setfreq M16
Hsersetup B57600_16,%10000   '//  Data True,  Receive disabled ( normal I/0)
pause 1000 '// Stabilize
 
hserout 0, (254,1) : Pause 50  '// Clear the display
hserout 0, ("Picaxe 08M2")
hserout 0, (254,192,"LCD Test")

MAIN:
   Do

   Loop
Source Code: http://dangerousprototypes.com/forum/download/file.php?id=8303
Diagram: http://dangerousprototypes.com/forum/download/file.php?id=8255&t=1

Enjoy
 
Last edited:
Top