| Author |
Message |
madmax55
Joined: 17 Jan 2007 Posts: 4
|
17 Jan 2007 23:40 serin+picbasic |
|
|
|
|
HI every one
iv got a problem with my codes,but only for pic16f877.!! Same codes work fine in 16f84a. I 'dont undestand WHY 'SERIN' command doesn't work with 877. i bought differnt 877 , 'SEROUT' command works fine, but 'SERIN' not!
where do i make wrong? PLEASE HELP ME!
these are the codes.
----------------------------------------------
GRS var byte
SerGRS var portE.0
SerCKS var portE.1
Frek con 6
serout serCKS,frek,[13,"MEDIA AND COMMUNICATIONS.!",13,10]
loop:
serin serGRS,frek,GRS
serout serCKS,frek,[13,GRS,10]
goto loop
|
|
| Back to top |
|
 |
yo5oqa
Joined: 21 Oct 2004 Posts: 20 Helped: 3 Location: Romania
|
18 Jan 2007 6:26 picbasic pro serout problem |
|
|
|
|
Maybe you have to make PortE.0, PortE.1 digital inputs, not analog (by default they are analog).
Adcon1=0x02 or something else (see the datasheet)
|
|
| Back to top |
|
 |
Google AdSense

|
18 Jan 2007 6:26 Ads |
|
|
|
|
|
|
| Back to top |
|
 |
madmax55
Joined: 17 Jan 2007 Posts: 4
|
18 Jan 2007 22:10 picbasic pro keyboard |
|
|
|
|
| yo5oqa wrote: |
Maybe you have to make PortE.0, PortE.1 digital inputs, not analog (by default they are analog).
Adcon1=0x02 or something else (see the datasheet) |
i tried to convert to digital and datasheets says to convert to digital it must be ADCON1=6. but it didn't work.
i tried other ports(D,B,C) but they didn't work too.i really don't know WHY it is not working.the code i wrote;
GRS var byte
SerGRS var portE.0
SerCKS var portE.1
Frk con 6
ADCON1=%01100000
serout serCKS,frk,[13,"MEDIA AND COMMUNICATIONS.!",13,10]
loop:
serin serGRS,frk,GRS
serout serCKS,frk,[13,GRS,10]
goto loop
|
|
| Back to top |
|
 |
madmax55
Joined: 17 Jan 2007 Posts: 4
|
22 Jan 2007 13:20 Re: PICBasic Pro Compiler Problem |
|
|
|
|
Thank you yo5oqa,
i solved the problem thanks to your advice. the problem was, indicator led on the RX pin line. this led was blinking when i press a button on the keyboard. i removed the led and the problem solved.
it's interesting, because i use the same technique on pic16f84a RX pin , and it works fine with that. anyway thanks again
|
|
| Back to top |
|
 |