Sertxd

benbaker7

Well-known member
Hi Folks. In experimenting with sertxd p219 pt 2, I get about 60% garbage each line, before printing ' the value of b1' etc. I've tried debug all places, with the same result. The processor is an 08m2, 5v, and a capacitor across pins 1 and 8, pe5 and xp. Where have I erred?
Ben Baker
 
Hi Folks. In experimenting with sertxd p219 pt 2, I get about 60% garbage each line, before printing ' the value of b1' etc. I've tried debug all places, with the same result. The processor is an 08m2, 5v, and a capacitor across pins 1 and 8, pe5 and xp. Where have I erred?
Ben Baker
Post your full program please Ben.
 
Hu eclectic. Program exactly as per page 219, with the inclusion of 'debug' in the line after sertxd - but I've tried placing it in all other possible locations - same result. Also tried an alternate picaxe. Beats me - sure would appreciate suggestion(s).
 
Ben,

The symptoms you describe match what can happen when the baud rate you are using in PE does not match the baud rate being used by the PICAXE chip. Also from page 219: "The baud rate is fixed at 4800,n,8,1 (9600,n,8,1 on X2 parts)"

What is the baud rate you have set in the PE Serial Terminal? This will need to match the correct value for the M2 or X2 model of each chip you test with.
 
Hi flenser. Yes. Serial terminal is set to 4800 n 8 1.
I also note that when a download occurs, a screen headed 'debug' appears. To get the serial terminal screen, I have to x out of the latter and use f8, even though I've selected open after download from the options/editor menu
 
Hi flenser. Well I seem to have solved the problem. By removing the debug command, everything works perfectly, including auto opening of the serial terminal screen. Must be a reason there somewhere, but for the moment, I'm happy. Thank for your interest.
Ben b
 
"Note that the debug command uploads a large amount of data and so significantly slows down any program loop. To display user defined debugging messages use the sertxd command instead. Note that on 08 and 14 pin chips debug acts on 'B.0 / output 0'. Therefore programs that use output 0 may corrupt the serial data condition."
Pin 0 on the 08M2 is the serial out (sertxd) output as well. You probably had two things trying to write to the screen at about the same time.
 
By removing the debug command, everything works perfectly, including auto opening of the serial terminal screen. Must be a reason there somewhere,
Hi,

SERTXD and DEBUG use different protocols but (must) use the Same PICaxe pin with ALL of the PICaxes. Therefore, the Program Editor/Terminal will almost certainly get "confused" if both instructions are used together. Generally, the "SERTXD" pin is the only data connection back from the PICaxe to the Terminal Emulator, so it's very much a case of using Either SERTXD Or DEBUG, but not both. Experienced PICaxe users ALWAYS use SERTXD (in preference to DEBUG) and/or perhaps SEROUT on a different pin (via a different cable) to a different Terminal.

You need to be particularly careful with the 08M2 because DEBUG, SERTXD , SEROUT, HSEROUT (and the DAC) etc. all use the same pin (c.0).

Cheers, Alan.
 
Back
Top