A bit of 08M magic - Comms over download cable

hippy

Ex-Staff (retired)
Using the same cable for download and run-time communications without swapping cables has always been a bit of a challenge for the PICAXE-08M, having no SERRXD command. The easiest solution has been to add an extra 22K and a link between SI and 0V; remove link to download, fit link for run-time comms. A bit of a fiddly nuisance ...

Code:
TX <---------------------------------------.
             22K             .---------.   |
             ___             | +V   0V |   |
RX >----.---|___|----.-------| SI   O0 |---'
        |    ___     |       | X4   X1 |
        |---|___|----|-------| I3   X2 |
       .|.   22K     |       `---------'
       | |           O -.
       |_| 10K       O -' Link to run
        |            |
0V -----^------------^----------------------
Here's a simpler software driven solution which works for me, but use at your own risk ...

Code:
TX <---------------------------------------.
                             .---------.   |
             ___             | +V   0V |   |
RX >----.---|___|----.-------| SI   O0 |---'
       .|.   22K     |       | X4   X1 |
       | |           `-------| I3   X2 |
       |_| 10K               `---------'
        |
0V -----^-----------------------------------

Pause 500
SerOut 0,N2400,("RESET",CR,LF)
Poke $10,%00001111
Do
  SerIn  3,N2400,b0
  SerOut 0,N2400,("<",b0,">")
Loop
This enables the LP ( Low Power ) Oscillator for Timer 1 which reconfigures the SI and X4 pins internally so download initiations are completely ignored. The disadvantages are that it needs a Hard Reset, power off then on, to do any download, and X4 is no longer available for use. It should not affect SERVO, PWMOUT or other commands which rely on Timer 2 operation. I'm not sure what relies on Timer 1 if anything.

Try the program without the "POKE $10" and you will see the 08M issuing the "RESET" message whenever you send data. With the "POKE $10" in place it works as expected, echoing data sent via the Programming Editor Terminal.

Note there's no need for a clamp diode on Pin 3 as it is connected to SI and its internal clamping diode does the job required.
 
Last edited:

manuka

Senior Member
Hippy: Mmm-an interesting one, although the apparent loss of Pin 4 may be a tad grim. Like many others,I've previously pondered both diverse 08M "Leg 2" applications & use of that LP internal oscillator. I'll give this a whirl! Stan
 

hippy

Ex-Staff (retired)
Yes, one of those prices to pay. Still it's handy for PC serially-driven simple peripherals or interfaces and probably costs less than the cable.

The good news is it also appears to work with the 14M and 20M so that allows up to 9600 baud and a lot more I/O. [Edit] Though both of course support SERRXD anyway !
 
Last edited:
Top