Re: Code for Send/Receive TTL/Comport Sample?
ive been hooking it directly to PIC as I dont have a MAX232 chip or anything else available right now, I was told by the seller that I should be able to hook this cable directly to PIC but they had no help files, schematics, code etc.. available.
I have modified code for transmit to PC only, after I see something come in then I can work on the receive side. Here is my complete code right now, and I am using the microcode studio serial tool for connections.
Code:
'* Notes : *
'* : *
'****************************************************************
Define OSC 20
define HSER_BAUD 9600
DEFINE HSER_BITS 8
DEFINE HSER_CLROERR 1
RCSTA = $90
TXSTA = $24
TRISC = %11000000
TRISD = 0
BAUDCON.4 = 0
BAUDCON.5 = 1
RCSTA.7 = 1
start:
Hserout ["Hello World", 13, 10] ' Send text followed by carriage return and linefeed
pause 1000
goto start
End
Chris
Any man who has accomplished anything in electronics at one time or another has said... " STOP! WAIT! NOOO! Dangit.... Oh Well, Time to start over..."
Bookmarks