Maker Pro
Maker Pro

Please help !!

paddy

Sep 11, 2012
81
Joined
Sep 11, 2012
Messages
81
Hi,

I am using MPLAB IDE version 8.60 for programming of microcontroller PIC18F4520. I have working code which I am using since last 1 year. But suddenly I am facing a weird problem from couple of days. When I am reprogramming the micro controller it is not functioning as expected. The same hardware is working fine with earlier controller which were programmed couple of months back.
I am using pickit3 and MCD2 for programming micro-controller. Even changed the PC too. I really don't understand what is going wrong.
Please advice.
 

Ehsan

Jun 12, 2014
100
Joined
Jun 12, 2014
Messages
100
What do you mean it is not functioning as expected ?

Does the micro-controller execute any program line ? can you debug the code ? I mean in-circuit debugging.
 

paddy

Sep 11, 2012
81
Joined
Sep 11, 2012
Messages
81
Hi,
Thanks for your advice.
There are five 7 segment displays, one indicates channel number and remaining four indicates process values. But now the channel number digit value is overlapping on process value segment and even the keys are working randomly(not as per program).
I have used debugging pins for seven segment display also through switch. so can't use both the functions simultaneously.
There is no modification in the code. Using the same code now also. What are the other possible reasons?
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
Are you totally sure there are no code changes? Perhaps you made a tiny modification that wasn't supposed to affect anything, but accidentally introduced a bug? Perhaps one of the project settings is wrong? Can you program a new device with a hex file that was actually built in the past when things were working properly? Can you read the code back out of an old device and program it into a new device?
 

paddy

Sep 11, 2012
81
Joined
Sep 11, 2012
Messages
81
Yes I am sure that there are no code changes. I have multiple files of that same code and programmed that with multiple chips also but every time facing the same problem.
Is there any method to copy the same code from old device to new device. Please guide.
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
If your old devices were programmed without code protection, you can read the data out of them. Start with the Microchip PICkit 3 user's guide (DS51795A) in section 9.4.1.
 

paddy

Sep 11, 2012
81
Joined
Sep 11, 2012
Messages
81
Hi KrisBlueNZ and Ehsan,

Thanks a lot for your support!!
I have used MCP3208 ADC for reading 8 different values and display it on 7 segment display.
During testing I found that when I am putting fixed value (anything in between 0 to 4095) for z manually, everything seems working fine.
But when I am reading from actual ADC, it gives error in functioning as mentioned above post.

It all related to ADC reading. Please suggest!!

Thanks!!
 

BobK

Jan 5, 2010
7,682
Joined
Jan 5, 2010
Messages
7,682
Well, you have discovered a new phase of programming. It is called debugging. Read up on it and dig in.

Bob
 

paddy

Sep 11, 2012
81
Joined
Sep 11, 2012
Messages
81
Hi,

Thanks for suggestions!!

I have re installed everything (CCS compiler as well as MPLAB IDE) and it starts working again!!
icon_surprised.gif
icon_surprised.gif


Thanks a lot for your help!!
 
Top