View previous topic :: View next topic |
Author |
Message |
rikotech8
Joined: 10 Dec 2011 Posts: 376 Location: Sofiq,Bulgariq
|
Problem with getc() |
Posted: Thu Aug 09, 2012 12:32 pm |
|
|
Why I can't get any character through rs232 ?
Code: |
#include <16f84a.h>
#fuses NOWDT
#use delay(clock=4M)
#use rs232(baud=9600, xmit=PIN_b0,rcv=PIN_b1)
void main()
{
while (true)
{
putc(getc());
delay_ms(100);
}
} |
When I press some letter on my keyboard, I get nothing on the screen.
Maybe there is something wrong in my code.
I test it on ISIS Proteus. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Thu Aug 09, 2012 12:54 pm |
|
|
The most likely reason is that Proteus doesn't support software "bit banging" serial communications.
Change to a PIC that has a hardware UART, connect to the UART pins,
and try again. For example, 16F88, or 16F887. |
|
|
Douglas Kennedy
Joined: 07 Sep 2003 Posts: 755 Location: Florida
|
|
Posted: Thu Aug 09, 2012 6:59 pm |
|
|
I don't see the advantage for this board in fielding Proteus questions.
First the issues appear to give the benefit of doubt to Proteus and pass the issue as a probable CCS compiler error. These Proteus false negatives toward CCS call into question the quality of the CCS Compiler. Establishing that Proteus is the issue does nothing since Proteus probably doesn't accept bug reports from this board. Sure the questioner can always pull the wool over our eyes and say there is a real PIC and circuitry but that dishonesty shouldn't mean that this board accepts the diversion a blatant Proteus question creates for this board. |
|
|
|