PDA

View Full Version : Pic16f690 Hserin



MARGARITA
- 26th May 2008, 01:59
HI
I'm experiencing a problem with HSERIN command using Pic16F690 a sample PBP code, does not receive any character, but the sending of characters it work fine ( Hello World ).
If I use PIC16F877 OR PIC16F627A the code works fine, any help?

' PicBasic Pro program to send and receive from
' the hardware serial port

DEFINE HSER_BAUD 2400 ' Select the baud rate
char var byte ' Storage for serial character

start:
Hserout ["Hello World", 13, 10] ' Send text followed by carriage return and linefeed

loop:
Hserin 10000, start, [char] ' Get a char from serial port
Hserout [char] ' Send char out serial port
Goto loop ' Do it all over again

End

skimask
- 26th May 2008, 03:14
Which version of PBP are you compiling with?

MARGARITA
- 26th May 2008, 15:15
Hello Skymask, Is Pbpro 2.46

MARGARITA
- 26th May 2008, 15:24
Hello Skimask, Pbp Version Is 2.46 Thanks In Advance For Your Help.

Bruce
- 26th May 2008, 16:09
Make sure you have the latest patch http://www.microengineeringlabs.com/support/patches.htm

MARGARITA
- 26th May 2008, 19:31
Thanks Bruce Yes I Have Already Done, Sorry Everybody But English Is Not Mi Natal Language, The Curious Is With Pic 16f877 And Pic16f627a Work Without Any Changes, Of Course I Select The Apropiate Microcontroller In My Programmer And Microcode Studio.

mister_e
- 26th May 2008, 20:15
Datasheet page 8. RX pin is also AN11, you should disable it.

Datasheet page 120, table 9-2

ANSELH=0

Bruce
- 26th May 2008, 22:08
ANSELH=0 should cure that.

MARGARITA
- 27th May 2008, 04:15
thanks guys, ANSELH=0 fix the code, now is working. sorry but I AM new to micro programming.

mister_e
- 27th May 2008, 04:19
;) You're welcome. We all have to begin somewhere, and one day we all had problem like that.

In case of doubt, refer to the following thread
http://www.picbasic.co.uk/forum/showthread.php?t=561
Post #2 have a nice PDF, i suggest you to keep it handy somewhere on your hard drive.

Have fun!