Hi, I'm new to GCBASIC (which I think is fantastic BTW). I've made LED's blink etc. Now I want to send serial data to my pc. I've looked at the examples but cannot get my head around how I use the hardware USART on my 16F628A and 16F877A's? Can someone give me a simple example of how I send a stream of "A" in GCBASIC?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi, I'm new to GCBASIC (which I think is fantastic BTW). I've made LED's blink etc. Now I want to send serial data to my pc. I've looked at the examples but cannot get my head around how I use the hardware USART on my 16F628A and 16F877A's? Can someone give me a simple example of how I send a stream of "A" in GCBASIC?
Try this:
https://sourceforge.net/forum/forum.php?thread_id=1664683&forum_id=629990
I don't know how it will work on the '628 and '877, try it and post if you have any trouble.
The alternative is to use the software serial routines. This code is quite old now, but should still work:
#chip 16F628A, 4
#config Osc = Int
#define SendAHigh SET PORTB.2 on
#define SendALow SET PORTB.2 off
dir PORTB.2 out
InitSer (1, r2400, WaitForStart+1, 8, 1, none, normal)
'Startup delay, can probably be removed
wait 1 sec
'Send "a"s
Do
SerPrint "a"
Wait 10 ms
Loop