RS232 interface

Questions on UARTs, and serial communication
YahooArchive
Posts: 1462
Joined: Fri Oct 19, 2012 5:11 am

Re: RS232 interface

Post by YahooArchive »

I use this cheap,simple circuit for level conversion and inversion.

http://www.botkin.org/dale/rs232_interface.htm

Should probably change the 5v to 3.3.

cp



YahooArchive
Posts: 1462
Joined: Fri Oct 19, 2012 5:11 am

Re: RS232 interface

Post by YahooArchive »

Hello and thanks for the help...


Well I've gotten this far.
I have gotten my PRO+ to talk to the Wyse terminal using RS 232 serial.
Using the following code:


SUB PrintUART1 (Astr(100) as STRING)
DIM I as INTEGER
I=0
WHILE Astr(I)
TXD(1) = Astr(I)

I=I+1
WAIT(100)
LOOP
TXD(1)=10
TXD(1)=10
TXD(1)=13
END SUB
'
'
main:
BAUD(1)=19200 ' enable UART1
'
'
PRINTUART1 ("MAIN MENU")
PRINTUART1 ("1 BUILD FILES LIST")
PRINTUART1 ("2 EDIT TIMES FOR WATER CHANGES")
PRINTUART1 ("3 ENTER SYSTEM PARAMETERS GALS, PH, KDH TEMP")

PRINTUART1 ("ENTER YOUR CHIOCE")

'INPUT FROM DUMB TERMINAL

DIM MyByte

' Wait for serial input on pin UART1


DO

MyByte = RXD(1)
UNTIL MyByte >= 0
PRINT
PRINT MyByte
PRINT
END


This sorta works but only provides me with ASCII of the keys pressed on the
dumb terminal. Does anyone have any ideas on how to input strings of data etc to
the pro plus from the wyse using Uart1


basically I need to pass string data form one to the other

As for my previous post about the signals having to be inverted the answer is
yes they do...

YahooArchive
Posts: 1462
Joined: Fri Oct 19, 2012 5:11 am

Re: RS232 interface

Post by YahooArchive »

Pompey
I basically built the same circut from transistor last night
but I used mosfet from the junk box parts that I could find

but the one from Futurlec is on the way (see other posts)
thanks rich

YahooArchive
Posts: 1462
Joined: Fri Oct 19, 2012 5:11 am

Re: RS232 interface

Post by YahooArchive »

In that same PC_2_ARM example in the User Projects in the files section here

getline reads a string from a UART, it saves it in the string COMMAND

I've updated that example to handle backspace

YahooArchive
Posts: 1462
Joined: Fri Oct 19, 2012 5:11 am

Re: RS232 interface

Post by YahooArchive »

I know the serin and serout commands tie up resources but I think that they
would so much easier to use.

Is it possible to use serin and serout on the pro? it seems like anytime I have
tried all I come up with is lots of errors no matter what I seem to do.
I'm running the latest version of basic tools and I think I have all of the
libraries that I need could you post some examples?

Thanks
Richard

YahooArchive
Posts: 1462
Joined: Fri Oct 19, 2012 5:11 am

Re: RS232 interface

Post by YahooArchive »

The SERIAL.bas file needed to be updated for the new compiler that assigns
RXD(x), BAUD(x) and TXD(x) to UART hardware. That version here in the files
section.

The bit-banged routines now have bbRXD(pin), bbBAUD(pin) and bbTXD(pin).

Examples in the help files updated.

So while you could use bit-banged, the UART hardware is more flexible and will
perform better. You could re-arrange the UART sample code to look more like
SERIN, SEROUT.

Post Reply