PDA

View Full Version : Problems with SERIN2 using PIC16F689



jesusbaez
- 11th February 2010, 18:30
Dear Sirs,Madams:

I am having problems to implement Serin2 in a pic16f689.

This is the code I am using:

MainLoop:
SERIN2 Rxpin,84,[STR test8/8]
'instructions to process incoming data and reply with data (i.e. serout2)
Goto Mainloop


Where

Rxpin: Rx pin (PORTB.5 in PIC16F689 and PORTC.7 in PIC16F877A)
84: 9600,8,n,1
test8 declared as var byte[8]


This code works fine with PIC16F877, waiting for 8 characters to be received before processing incoming data but it does not work with PIC16F689.

When I run it in PIC16F689, it does not wait incoming data to arrive and executes instructions to process incoming data.

Your help will be greatly appreciated

Thanks

Sincerely,

Jesús Baez

Bruce
- 12th February 2010, 14:32
PORTB.5 on the 16F689 is analog at power up. Place ANSELH=0 in the top section of your
code to disable A/D on this pin.

jesusbaez
- 12th February 2010, 23:00
Dear Bruce

Thanks for your help!

Regards,

Jesús Baez