AXE027 cable and PICAXE-08 Proto Board

Dermotx

Member
Hi,
I just want to flash an LED from the keyboard of a PC running Win7 64, an AXE027 cable and the PIC 08 proto board. I'm using the 08M2 chip.
Here's the code I'm using:

Code:
main: 
	serin 3,N2400,b1 
	if b1=1 then high 4
	endif
	pause 1000
	low 4
	goto main
It works fine in the simulator so I'm guessing it's a hardware problem. I can download a program no problem to the 08M2 and I've tried the jumper on the proto board in both positions.
I'm presuming this can be done with the proto board or do I have to make a separate circuit?

I've looked up the manuals but am a bit confused when they talk about a serial cable. Do they mean the old serial cable or are they referring to the USB to serial converter cable (AXE027)?

I've tried using the serial terminal in the Program Editor to input the digit 1 to get the LCD to flash in a number of ways. I've used 1,"1",49 and "49" but all I get from the input buffer is strange ASCII hierogliphics like this ŒŒÌŒŒÌŒŒŒŒŒŒÎŒŒÌŒŒ.

One further thing: I've downloaded the simple LED flasher program onto the 08M2 and kept it on the proto board and it flashes away nicely but when I reload the above program, no flashing.

Any help would be appreciated. Thanks.

Regards
Dermot
 

Dermotx

Member
Hi Paul. Thanks for the quick reply, but no joy, I'm afraid. Again I tried inputting 1,"1",49 and "49" into the terminal but no flashing LED. I then downloaded the simple led flasher program onto the 08 just to make sure the LED is still working and it flashed no problem!

Regards
Dermot
 

nick12ab

Senior Member
Have you disconnected the output of the download circuit from the Serial In pin and connected it to pin 3 (leg 4)?
 

Dermotx

Member
Hi Nick. I've moved the jumper on the proto board from the "prog" position to the "out" position which I think accomplishes what you mentioned. I tried it in both positions with no luck.
I think it would probably be helpful if I eliminated the proto board from the equation and breadboarded the circuit. If someone could just give me a simple diagram of how to connect the three parts of the stereo plug (Rx, Tx and ground) on the AXE027 to the 08M2 and the positions of the resistors I think it would help me progress.

Thanks
Dermot
 

nick12ab

Senior Member
Hi Nick. I've moved the jumper on the proto board from the "prog" position to the "out" position which I think accomplishes what you mentioned. I tried it in both positions with no luck.
That jumper is for the Serial Out pin. It's the Serial In pin which is receiving the signal from the computer and this signal needs to be connected to pin 3.

I think it would probably be helpful if I eliminated the proto board from the equation and breadboarded the circuit. If someone could just give me a simple diagram of how to connect the three parts of the stereo plug (Rx, Tx and ground) on the AXE027 to the 08M2 and the positions of the resistors I think it would help me progress.
Building it on breadboard would be a good idea. The download circuit is in PICAXE Manual 1 but for breadboard use the download socket will need to be connected via short single core wires. The minimum circuit for the 08(M)(2) is also in PICAXE Manual 1.
 

Dermotx

Member
Hi Nick. I think you've solved the problem for me. The output from the computer to communicate with the 08M2 on the proto board is connected to pin 5 (leg 2) which is the serial download input pin. The serin command cannot be used with this pin. Picaxe Manual 2 page 205 states:

" The serin command is used to receive serial data into an input pin of the
microcontroller. It cannot be used with the serial download input pin, which
requires use of the serrxd command instead."

I've tried the following which unfortunately didn't work but I think I'm getting closer to a solution:

Code:
main: 
	serrxd b1 
	if b1=1 then high 4
	endif
	pause 1000
	low 4
	goto main
This works in the simulator but not with the protoboard. The strange thing is though that the simulator let me use pin 5 with the serin command and the syntax check didn't pick it up either?
Ah well, tomorrow's another day!
Thanks again.

Dermot
 

westaust55

Moderator
Check that with the 08M2 at default 4 MHz clock speed that the PC is using a 4800 bps baud rate.

When you used the SERIN command in the PE, the PE may assume (?) that you have previously issued the DISCONNECT command.
 

hippy

Ex-Staff (retired)
This works in the simulator but not with the protoboard.
This is probably more an issue of how the data is being sent, received and processed. If, on the physical chip, you are typing 1 in the Terminal window then that is actually sending ASCII character "1" not decimal value 1. You need to check 'b1' against the ASCII value not the decimal value -

If b1 = "1" Then ...

The strange thing is though that the simulator let me use pin 5 with the serin command and the syntax check didn't pick it up either?
Modern PICAXE chips allow the download Serial In to be used as a digital input so the 'must use SERRXD' is no longer strictly correct; SERIN 5 is equally valid but a DISCONNECT command must be issued first.
 

Dermotx

Member
Thanks for that Hippy and Westauss55. I tried the following code and it flashed:

Code:
main: disconnect
	serin 5,N2400,b1 
	if b1="1" then high 4
	endif
	pause 1000
	low 4
	goto main
It seems you can you serin with the serial download input pin. Thanks to all who helped.

Regards

Dermot
 

nick12ab

Senior Member
Your use of the disconnect command shows that you are using an M2 part and you have stated that too. As you are using an M2 part, you should use the new pin notation:
I believe hippy was simply just trying to clarify which physical pin (aka leg) corresponds to which PICAXE logical pin in the BASIC program.

If you look at datasheets, they refer to the physical pins as "pins"

In the PICAXE programming logic an IO point is defined by the Port.Pin nomenclature and reference to a "pin" is in the logical terms.

To avoid confusion many folks on the PICAXE forum use the term "leg" to refer to the physical pin.

All IO pins (except a few which are permanently outputs) are set as inputs at power up. This is a Microchip PIC default which Rev Ed retain for good reason within the PICAXE firmware.

Whether you need to instruct the IO pins to be outputs depends depens upon the BASIC command you are using.
Commands such as HIGH and LOW with automatically change the pin to an output.
Commands such as LET pinB.7 = 1 or pinsB = %10101010 do not change the pin(s0 to outputs and the DirsB (or DirsC, etc) command needs to be used first.
Use of the old port notation isn't a big deal on a PICAXE-08M2 since there is only one port you really should use the new notation unless you are sure that you won't ever want to move the code onto another M2 part where you'll then have to change all the pins anyway otherwise it willl get confusing!

In addition, all complete code listings should use the #picaxe directive - then it's perfectly clear what PICAXE the code is for even if you haven't used the proper pin notation.
 
Top