Hserout Issues with hardware serial output

magudaman

Member
So I have just started to play with a new 20m2 chip that I am using for a project and just spent the last 2 hours trying to get my AXE133 serial lcd to work. I finally busted out the scope and could clearly see there was a problem with the output on signal. For some reason the square waves are jittering really bad. If I switch back to software serial then steady as can be and works. Back to hardware no go. So what is happening?! The hardware setup is barebones, 10k and a 22k resistor and 5v regulator with a couple filtering caps. Any ideas? I am just trying to write hello:

Code:

int:

setfreq m4

hsersetup b2400_4, %10

hserout 0,(254,1)

Pause 2000

Main:

hserout 0,("hello")

pause 50

goto main
 

SAborn

Senior Member
I dont think you need the resistors on a Hserout pin, only need the resistors on the serin programming port.

You are connected to C.0 on the 20m2 chip for Hserout?
 

hippy

Ex-Staff (retired)
Jittering on HSEROUT could be a result of how the scope is set up for timebase and triggering.

The AXE033 and AXE133 both need a time between each byte of data sent to process what has been received so sending multiple bytes in a single HSEROUT command may not provide enough time. Try sending only one byte per HSEROUT with a PAUSE after each
 

magudaman

Member
A circuit diagram would help us a lot.
I just have the two minimum required resistors and am directly connect to the serial line of the AXE133. It just on a breadboard.

Jittering on HSEROUT could be a result of how the scope is set up for timebase and triggering.

The AXE033 and AXE133 both need a time between each byte of data sent to process what has been received so sending multiple bytes in a single HSEROUT command may not provide enough time. Try sending only one byte per HSEROUT with a PAUSE after each
Well I tried the scope both hardware and software at the same baud and sure enough the software one look perfect and the hardware has a bad gitter. I even tried software, then locked down all the scope settings went back to the hardware and can still see that bad gitter.

Do I need a 10K resistor to ground on the serial output line?
 

DaveC166

Member
Ive had the the same problem with 2 18m2's and axe033 LCD. Serout on PinB.6 works fine HSEROUt (on PinB.6) the axe033 displays garbage. ive since upgraded to a 20X2 and HSEROUT works ok with the AXE033. I didnt fiure out what the problem was.
I connect a 800 ohm series resistor between the serout pin and LCD input to limit potential fault current. you dont need a 10K resistor to ground on the serial out
 

hippy

Ex-Staff (retired)
To repeat; the AXE033 and AXE133 need some time between receiving one data byte and the next in order to process the data and update the LCD or OLED.

While SEROUT provides a sufficient gap between bytes sent HSEROUT includes little or no gap. This is because the SEROUT is software bit-banged; it has to send a byte, determine what the next is, then send that. HSEROUT is high-speed hardware so the next byte can be determined while the UART is sending the last, and it can send that byte as soon as the last has been sent.

When sending data to an LCD using HSEROUT it will usually be required to send single bytes and include an explicit PAUSE after each byte to give the AXE033 or AXE133 time to process each byte received and be ready for the next before that is sent.

If bytes are sent before the AXE033 or AXE133 is ready for them the bytes might not be displayed, corrupt characters may be shown, or data may be misinterpreted as commands to do something with the display which was unexpected ( clearing the screen, positioning the cursor etc ).
 
Top