PDA

View Full Version : Serial communication with pic18f452



tamersoss
- 30th December 2007, 20:40
Dear Freinds ...

I Have a project where two Pic's exchanges messages ... The problem is that Pic18f452 which is the master mcu in my project become unresponding after several serial communications with the slave one ... In the top of my program , I put this line :
Adcon1 = 7 to make all analog pins digital ... But when i searched the datasheet i found 011x ... What does this
'x' refer to ?

mister_e
- 30th December 2007, 20:56
'x' mean don't care, so it could be 1 or 0.
For you communication problem, if you use the PIC USART and HSERIN make sure you do some error trapping or insert DEFINE HSER_CLROERR 1 at the top of your code.

If you're not using the PIC USART but use SERIN/SERIN2/DEBUGIN etc etc... well you may some problem depending how your code flow and how you have implemented it. Of course if you use them on your favourite I/O, make sure you have disable all multiplexed features such as analog comparator, ADCs, voltage reference etc etc.

HTH

tamersoss
- 30th December 2007, 21:01
So what can make a pic18f452 unresponding ?

mister_e
- 30th December 2007, 21:02
I've edited my post while you replied..
asm
GOTO $-2
endasm
;)

tamersoss
- 30th December 2007, 21:12
I uses Serout and serin and i disabled analog by 'adcon1 = 7'

Ioannis
- 30th December 2007, 21:27
Why don't you post your code to have a look over it?

It might be easier to debug...

Ioannis