Solving an intermittent 18F2431 PIC problem

Thread Starter

camerart

Joined Feb 25, 2013
3,724
Hi,

An intermittent PIC problem has returned:(

3x 18F2431 Programmed using Pickit2 and 3, with added voltage supply. I've read two different PICs using MPLAB and compare the HEX files, the same.

They were programmed using an adapted socket which GNDs PIN 28 (PGM).

PIC1: Works most times, and once started works fine. I noticed that the PIC is not on the adapted socket, so all free pins are floating. There is a LED toggle to show that the PIC has initialised. If the PIC doesn't initialise, I can touch pin 28 (Or the circuit reset button) and it initialises. If I put the PIC on the adapted socket it doesn't work. If I don't use a socket it works. If I set up all free PORTB PINs to 0 (including PIN28) it doesn't work.

PIC2 and 3: Don't work under any conditions. They work otherwise.

I checked the circuit board for tracking between the PINS/TRACKS ok, and a motor for continuity of tracks, where I could.

Any ides of the likely problem welcome please.

Camerart.
 
Last edited:

ErnieM

Joined Apr 24, 2011
8,377
Got a schematic?

Got a definition of "works"?

How did you program MCLR? If it is set to be clear (and not I/O) do you have a pull up resistor on it?
 

spinnaker

Joined Oct 29, 2009
7,830
Hi,

An intermittent PIC problem has returned:(

3x 18F2431 Programmed using Pickit2 and 3, with added voltage supply. I've read two different PICs using MPLAB and compare the HEX files, the same.

They were programmed using an adapted socket which GNDs PIN 28.

PIC1: Works most times, and once started works fine. I noticed that the PIC is not on the adapted socket, so all free pins are floating. There is a LED toggle to show that the PIC has initialised. If the PIC doesn't initialise, I can touch pin 28 (Or the circuit reset button) and it initialises. If I put the PIC on the adapted socket it doesn't work. If I don't use a socket it works. If I set up all free PORTB PINs to 0 (including PIN28) it doesn't work.

PIC2 and 3: Don't work under any conditions. They work otherwise.

I checked the circuit board for tracking between the PINS/TRACKS ok, and a motor for continuity of tracks, where I could.

Any ides of the likely problem welcome please.

Camerart.
It didn't happen without a schematic.

All unused pins are floating. Does this include MCLR? If so there's one of your problems.
 

Thread Starter

camerart

Joined Feb 25, 2013
3,724
Hi,

See post #565 on thread: http://forum.allaboutcircuits.com/threads/gps-nmea-antenna-aiming-tracker.96520/page-29 for all technical information.

QEI_PWM1c--18F2431 AZ LVP 8MHz INT 110415 is the program.

See program DEFINE CONFIG4L, I think it is programmed for LVP. I normally use PICKIT2 with no extra power supply.

EDIT: There is a 10K pull up on RESET/MCLR PIN, but I'm not sure how it is programmed.

I hope I've answered all of the questions.

NOTE1: For testing the 18F2431 PICs, I inject the required data (e,g, A123E123) into PIN18 RX, from a computer terminal, and read the resulting data from PIN17 TX into a second terminal. The output of the 18F2431 PICs got to an H-Bridge, and motors move, also I can see on an oscilloscope, when it is working.

NOTE2: When it is not working and the reset button is pressed and the initialising LED flashes, it still does not work.

C.
 
Last edited:

ericgibbs

Joined Jan 29, 2010
18,766
hi C,
Why is LVP Enabled.???
E
Code:
Define CONFIG1L = 0x00
Define CONFIG1H = 0x08  '8MHz INT
Define CONFIG2L = 0x0c
Define CONFIG2H = 0x20
Define CONFIG3L = 0x04
Define CONFIG3H = 0x80
'Define CONFIG4L = 0x80  'LVP= 0 = Set for HVP
Define CONFIG4L = 0x84  'LVP= 1 = Set for LVP
Define CONFIG4H = 0x00
Define CONFIG5L = 0x0f
Define CONFIG5H = 0xc0
Define CONFIG6L = 0x0f
Define CONFIG6H = 0xe0
Define CONFIG7L = 0x0f
Define CONFIG7H = 0x40
Also /MCLR is being used as agreed, with a PU resistor.
Ref image from Oshonsoft.
 

Attachments

Thread Starter

camerart

Joined Feb 25, 2013
3,724
hi C,
Why is LVP Enabled.???
E
Code:
Define CONFIG1L = 0x00
Define CONFIG1H = 0x08  '8MHz INT
Define CONFIG2L = 0x0c
Define CONFIG2H = 0x20
Define CONFIG3L = 0x04
Define CONFIG3H = 0x80
'Define CONFIG4L = 0x80  'LVP= 0 = Set for HVP
Define CONFIG4L = 0x84  'LVP= 1 = Set for LVP
Define CONFIG4H = 0x00
Define CONFIG5L = 0x0f
Define CONFIG5H = 0xc0
Define CONFIG6L = 0x0f
Define CONFIG6H = 0xe0
Define CONFIG7L = 0x0f
Define CONFIG7H = 0x40
Also /MCLR is being used as agreed, with a PU resistor.
Ref image from Oshonsoft.
Hi Eric,

It must have been a choice between two past programs.

Is LVP 3.3v and HVP 5V ? If so I can see that it should be HVP.

Thanks, C.
 

Thread Starter

camerart

Joined Feb 25, 2013
3,724
Last edited:

Papabravo

Joined Feb 24, 2006
21,159
It is simple programming. You simply have to know and nail down each and every possible configuration choice. It is the ONLY way to go.
 

Thread Starter

camerart

Joined Feb 25, 2013
3,724
It is simple programming. You simply have to know and nail down each and every possible configuration choice. It is the ONLY way to go.
Hi PB,

What I meant by simple programming was that I used to use a simple programmer (Velleman) but perhaps all this was applicable then, and I got away with it.

C.
 

spinnaker

Joined Oct 29, 2009
7,830
Hi PB,

What I meant by simple programming was that I used to use a simple programmer (Velleman) but perhaps all this was applicable then, and I got away with it.

C.
There is another problem. Get yourself a pick it iii. And we are still waiting on the schematic.
 

spinnaker

Joined Oct 29, 2009
7,830
Found it on that other thread. You sure make things difficult for others to help. Is mclr floating? It is not immediately apparent as to how it is wired.
 

spinnaker

Joined Oct 29, 2009
7,830
Do you have a bypass capacitor? How is the circuit wired? Is it a PCB or is it a perf board? If prefboard have you checked all of your connections? If PCB have you checked all of your solder joints? Any cold solder joints?
 

Thread Starter

camerart

Joined Feb 25, 2013
3,724
Do you have a bypass capacitor? How is the circuit wired? Is it a PCB or is it a perf board? If prefboard have you checked all of your connections? If PCB have you checked all of your solder joints? Any cold solder joints?
Hi S,

All of your questions are answered already in the thread, especially if you look again at the link in post #7.

C.
 

spinnaker

Joined Oct 29, 2009
7,830
Hi S,

All of your questions are answered already in the thread, especially if you look again at the link in post #7.

C.
I am not seeing any of those questions answered in this thread. Again, why are you making it so difficult for others to help you. Even if you need to answer the same questions twicw even three times, it is all of us taking our time to try and help you. Not the other way around.
 
Top