Re: Code for Send/Receive TTL/Comport Sample?
OK I got it to work , not sure why but I had to change OSC fuse to ECIO and not ECPIO, so even though im useing a ttl OSC I cant use RA6
heres the code that works, note fuse is set to ECIO(NO USB) and PLL is set to 20Mhz
Code:
Define OSC 20
define HSER_BAUD 9600
DEFINE HSER_BITS 8
DEFINE HSER_CLROERR 1
RCSTA = $90
TXSTA = $20
TRISC = %10000000
TRISD = 0
start:
Hserout ["Hello World", 13, 10]
pause 1000
goto start
End
NOTE: TXSTA = $20 ' must be 20, 24 doesnt work, even though online articles said so.
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