SX and Parallax USB2SER

I’ve put together various posts and downloads to get info on the USB2SER·working with my Hyperterminal and SX Tech Tool.
I’m close, but hypertext is showing me garbage instead of a message.
·
Note that I·for programming and debug I·use the Parallax USB to Serial convertor which then goes to a serial cable to my SX for programming and debugging (COM4). That stays plugged in while running the program.· For the USB2SER I use a second USB port and cable to COM5.·
·
Here is what I did:
·
Plug the USB2Ser via cable into PC
Driver was found and message that the hardware is ready to use
Check COM assignment = COM5
Change com5 latency from 16 mSec to 1mSec
SX breadboard connectsion from USB2SER to SX
RES to 20k resistor to RB.0 necessary or optional?
TX to 20k resistor to RB.2·· resistors necessary?···········
RX to 20k resistor to RB.1
Vss direct to Vss
Set up hyperterminal
New connection, give name
Connect Using COM5
Set Post settings to defaults
Bits per second = 2400
Data bits = 8
Parity = none
Stop bits = 1
Flow content = Hardware
session is automatically started.
·
>>>>>>>>>>>>>·
·
Test #1 Program in SX/B
DEVICE········· SX28, OSC4MHZ, TURBO, STACKX, OPTIONX
FREQ··········· 4_000_000
PROGRAM Main
Main:
· · SEROUT RB.2, N2400, "hello"
·
Load and run the program, view Hyperterminal
Observed: continious flow onto hyperterminal screen of an ASCII character (like an F – probably a double lined-border character)
·
>>>>>>>>>>>>>·
·
Test #2 Program in SX/B
DEVICE········· SX28, OSC4MHZ, TURBO, STACKX, OPTIONX
FREQ··········· 4_000_000
PROGRAM Main
Main:
· DO
· SEROUT RB.2, N2400, "hello"
LOOP
·Load and run the program, view Hyperterminal
Observed: one random character appear after each press od SX Tech Tool reset button
I’m close, but hypertext is showing me garbage instead of a message.
·
Note that I·for programming and debug I·use the Parallax USB to Serial convertor which then goes to a serial cable to my SX for programming and debugging (COM4). That stays plugged in while running the program.· For the USB2SER I use a second USB port and cable to COM5.·
·
Here is what I did:
·
Plug the USB2Ser via cable into PC
Driver was found and message that the hardware is ready to use
Check COM assignment = COM5
Change com5 latency from 16 mSec to 1mSec
SX breadboard connectsion from USB2SER to SX
RES to 20k resistor to RB.0 necessary or optional?
TX to 20k resistor to RB.2·· resistors necessary?···········
RX to 20k resistor to RB.1
Vss direct to Vss
Set up hyperterminal
New connection, give name
Connect Using COM5
Set Post settings to defaults
Bits per second = 2400
Data bits = 8
Parity = none
Stop bits = 1
Flow content = Hardware
session is automatically started.
·
>>>>>>>>>>>>>·
·
Test #1 Program in SX/B
DEVICE········· SX28, OSC4MHZ, TURBO, STACKX, OPTIONX
FREQ··········· 4_000_000
PROGRAM Main
Main:
· · SEROUT RB.2, N2400, "hello"
·
Load and run the program, view Hyperterminal
Observed: continious flow onto hyperterminal screen of an ASCII character (like an F – probably a double lined-border character)
·
>>>>>>>>>>>>>·
·
Test #2 Program in SX/B
DEVICE········· SX28, OSC4MHZ, TURBO, STACKX, OPTIONX
FREQ··········· 4_000_000
PROGRAM Main
Main:
· DO
· SEROUT RB.2, N2400, "hello"
LOOP
·Load and run the program, view Hyperterminal
Observed: one random character appear after each press od SX Tech Tool reset button
Comments
The internal 4MHz clock is not accurate enough for serial communications. It's something like +/- 8%.
Change OSC4MHZ to OSCXT1 and use the SX-Key or a 4MHz resonator for a clock source.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Cheap used 4-digit LED display with driver IC·www.hc4led.com
Low power SD Data Logger www.sddatalogger.com
SX-Video Display Modules www.sxvm.com
Don't mistake experience for intelligence. And vis-vera.
·
inserted 4MHZ resonator into xT header.
Changed code to (below)
Powered up and Ctrl+R, assembled OK & chip reported running
Removed power, removed SXkey
Powered up
Same problem of continous flow of chars to hyperterminal screen (but different character flowing to hyperterminal)
Flow stops while Reset held down
DEVICE SX28, OSCXT2, TURBO, STACKX, OPTIONX
FREQ 4_000_000
PROGRAM Main
Main:
do
SEROUT RB.2, N2400, "hello"
loop
No difference in result
Try:
SEROUT RB.2, T2400, "hello"
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Mike
Getting closer:
Now get a string of "h" characters rather then randoms.
If I put the SEROUT inside a do loop I get one "h"
Now, I just need the Ccockney greeting: 'ello
Sorry...........brain off line! You will need to write a routine to send strings out. The SEROUT will only send one character at a time. Take a look at the attached file. You'll need to modify as necessary for the PIN's, DEVICE, and FREQ.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Mike
I tested with a cheater program (five commands of SerOUT, each with one letter).
Nice simple routine.
P.S. Your first line could be "tmpw1 = __WPARAM12".
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Cheap used 4-digit LED display with driver IC·www.hc4led.com
Low power SD Data Logger www.sddatalogger.com
SX-Video Display Modules www.sxvm.com
Don't mistake experience for intelligence. And vis-vera.
·
Aren't you supposed to be out Haunting? Just kidding, Nice to see you are back!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Mike
Thanks for the wecome notes, and for the simplification (that one is almost a "D'oh!" moment, isn't it?).