Programming and serial output on the same pins

Marcwolf

Senior Member
Hi Folks.
It's late here and I have been working on this all day so please forgive and glaring assumptions.

With a Picaxe 08M2 can one use the Serial In (pin c.5) for non programming serial

What I want to do is to use a 08M2 and program it normally, then put it in a circuit with a USB to Serial on pins C.0 and C.5 so that it can be updated with a normal terminal program.

For simplicty I am using the 08 Proto-board as the basis for this project

This is a simple example.. But when I connect the serial IN from the USB-TTL to C.5 the picaxe basically resets.

Code:
b1 =0
main:
serin [100], c.5, T2400_4,#b2
serout c.0,T2400_4, (#b1," Hello   ",#b2,13,10)
pause 1000
b1 = B1 + 1
if B1 > 100 then
   b1 = 0
  end if
goto main
 

hippy

Technical Support
Staff member
You need to issue a DISCONNECT command or as soon as C.5 goes high the PICAXE thinks it's getting a download and stops running the program.
 

SAborn

Senior Member
The problem is using a USB-TTL adapter, the TTL version has the wrong polarity in idle (Normally idle high) and the picaxe needs idle low for normal operations, you can use an inverter between the USB-TTL adapter and picaxe or use a USB-Serial adapter which is normally idle low.
Regardless of which adapter you use you should still include the resistors for the download circuit.
 

hippy

Technical Support
Staff member
The problem is using a USB-TTL adapter, the TTL version has the wrong polarity in idle (Normally idle high) ...
You might be able to get away with using that by putting a diode between Serial In / C.5 / Leg 2 (cathode) and Serial Out / C.0 / Leg 7 (anode). Start the program with DISCONNECT then HIGH C.0

That relies on Serial Out initialising as output low, pulling Serial In low, before the chip first checks for a download when it powers up. The 22K protects the TTL serial input shorted towards 0V.

Seems to work but not exhaustively tested.
 
Last edited:
Top