PIC18F26K42

Thread Starter

Deepak R

Joined Oct 10, 2023
2
Hi All,
As I'm using PIC18F26K42 MC for our device(for controlling LED's), i flashed the PIC hex file to the device and set it for running after a particular period of time the PIC isn't responding no data from the PIC so i rebooted the device still the PIC isn't responding, then i re flashed the PIC and the same scenario happened after a particular time. In my POV i have came up with a conclusion that the image is erased from the controller if it's so what will be the cause of it?
If anyone have any suggestion this please share me ASAP
 

Jon Chandler

Joined Jun 12, 2008
1,564
In my POV i have came up with a conclusion that the image is erased from the controller
That's very doubtful – did you try reading out the hex file to see what's in the chip?

Does the code ever run – it's not clear from your post. If you set it to run after some delay and it never runs, there's likely an error in the code. Try removing the delay and see if it runs without it.
 

Thread Starter

Deepak R

Joined Oct 10, 2023
2
That's very doubtful – did you try reading out the hex file to see what's in the chip?

Does the code ever run – it's not clear from your post. If you set it to run after some delay and it never runs, there's likely an error in the code. Try removing the delay and see if it runs without it.
Yes the code runs for 4-5 hrs sometimes, In some cases it runs only for short period of time and this scenario is observed.
No i didn't tried to read the hex file, because i have put another device parallel with same code and it doesn't shows any behavior like this.
I think this might be an Hardware issue, do you have any suggestion in the hardware side?
If it so please let me know.
 

Jon Chandler

Joined Jun 12, 2008
1,564
Do you have a schematic and drawing of the circuit board? And a clear picture of the circuit board?

A few things could cause problems like this. Starting with the PIC:

● Bypass caps close to Vcc pins? 100nF
● Are all power and ground pins connected?
● Is /MCLR pulled high with a 10k resistor?
● Are any pins set as inputs floating?

For the last two points, if inputs are floating, they can fall in "no man's land" between LOW and HIGH and the PIC will hang where only removing power will restore it (voice of experience).

Regarding the 2nd point – if there are multiple ground pins or multiple Vcc pins, they all must be connected to ensure proper PIC operation.

How many LEDs are you driving? Are they driven directly from Port pins? How much current do they draw?


The power supply could be an issue – what's the power source? If using a voltage regulator, does it have the needed input and output caps?
 
Top