Page 1 of 1

PIC Basic Pro with RS-232

Posted: Mon Jul 09, 2007 11:12 am
by Gregory
I am using a Microchip PIC 18F4610 with a Sipex RS-232 level shifter.

I created code using the PIC BasicPro IDE. I went through the turoial on interfacing a Basic Stamp to a Matrix Orbital display. Is it possible to use the HSEROUT command instead of the SEROUT command? The reason I ask is because, the SEROUT command only allows for bauds up to 9600, while the HSEROUT can communicate at 19200. The HSEROUT command uses the PIC's hardware UART.

I tested the HEX strings from the PIC (using a RS-232 spy tool), and was receiving proper commands to clear the screen and display data. I also tested the display using the "Display Tuner" GUI and made sure it was set at 19200.

Also, I noticed that in the turoial, that you created seperate SEROUT command for each byte.
'SEROUT 1, 84, [254] 'Command Prefix
'SEROUT 1, 84, [88] 'Clear screen command
Does it not work if you put the bytes back to back?
'SEROUT 1, 84, [254,88] 'Clear screen command

THX :D
[/i][/b]

Posted: Mon Jul 09, 2007 11:20 am
by Raquel
Hello Gregory,

Thanks for your post.

I do not have a PIC BasicPro to try things out, unfortunately. I suggest that you check out the definition of SEROUT and see if it can only do one byte at a time, and at what speeds.

Also, with a scope, I suggest that you look at the RX line of the display and see that the display is getting the data you are sending it.

Thanks,

Posted: Tue May 06, 2008 2:51 pm
by maxis
Gregory,

I've had success using SEROUT2 (sec. 5.74) with PicBasic.

Has a lot of functions, can accept entire command line at once, with
serial rates up to 19,200 baud.

I send in decimal format, with success, using Max232 to interface
with default MO display setup. (no modifications, or jumpers
to deal with.)

Clearing display then goes like this:

SEROUT2 datapin, 32, 10, [254,88]

where: 32 defines baud 19.2 and 10 is for a 10 mSec, delay between
characters, since I am not using hardware flow control. This last is arbitrary, and could likely be shorter. Have yet to tweak it.

Hope this helps.