PDA

View Full Version : 18f252-i/sp



Armadus
- 29th August 2016, 17:06
I am using PIC Basic Pro (verson 2.47) and Micro Code Studio Plus to program two PIC18F252-I/SPs. Part of the program is to communicate between the two PICs, with Serin2 and Serout2 on PIC pins C4 and C5 as Tx and RX for two Laird AC4790 wireless radios.

Most of the time the communication works well, but sometimes it does not work at all with some PIC chips. I have recently had 4 out of 10 chips that I programmed not work on the serial communication, but the other input and outputs seem to work fine. I have used this program for several years with good results, but recently have had more problems. Any suggestions?

Dave
- 29th August 2016, 17:53
Code Please? We have NO idea what the problem is, as your post is rather vague..

HenrikOlsson
- 30th August 2016, 05:58
Baudrate out of spec for the radio? How are you generating the clock for the PICs?

/Henrik.

Armadus
- 30th August 2016, 14:54
Thanks for the reply. I am using a 9600 baud rate, and the clock is set as "HS" with a 20 mHz resonator. The code has worked for a couple of years, but sometimes it will not work with some PIC chips. The code for this project is very long, and I am working on getting the representative code posted.

HenrikOlsson
- 30th August 2016, 15:39
Aha, 20mHz - there's your proplem...just kidding - you mean 20MHz ;-)

Did you use the same PCB, same resonator and everthing else and ONLY swapped the PIC when 4 out of 10 didn't work? Or was it actually 4 out of 10 boards that didn't work?
Datasheet for the specific resonator you're using? Short of that, measure the actual bit-time generated to verify at which frequency the PIC is ACTUALLY running.

/Henrik.