PIC32 ADC Problem

General discussion on mikroC PRO for PIC32.
Post Reply
Author
Message
Bill Legge
Posts: 235
Joined: 28 Oct 2007 03:16
Location: West Australia

PIC32 ADC Problem

#1 Post by Bill Legge » 10 Apr 2023 08:38

My set-up is:
Easy PIC Fusion v7
PIC32MX795F512L MCU at 80MHz

I'll post some minimalist code,if necessary, but problem may be resolved:

1. Compile, build and program - everything is OK, ADC and display works fine.
2. Cycle power on the Easy PIC Fusion board - and it stops working.

Any ideas?

Regards Bill Legge in Australia.

hexreader
Posts: 1784
Joined: 27 Jun 2010 12:07
Location: England

Re: PIC32 ADC Problem

#2 Post by hexreader » 10 Apr 2023 15:17

Yes please - post minimalist project - whole project not just the code

I have same hardware and with luck, I may be able to reproduce the problem

Zip and attach the whole project folder as .zip file, not just the C code - I need to see full project setup (especially configuration bits)

First wild guesses might be:

1 Invalid oscillator frequency selections (see datasheet oscillator requirements)

2 A variable that should be initialised, but was not

3 Insufficient initialisation time for some peripheral such as UART or LCD

4 I2C device not responding

5 Something else that I have not thought about
Start every day with a smile...... (get it over with) :)

Bill Legge
Posts: 235
Joined: 28 Oct 2007 03:16
Location: West Australia

Re: PIC32 ADC Problem

#3 Post by Bill Legge » 10 Apr 2023 21:14

As usual - thanks very much for that.
I think your list of possible problems is probably correct.
I will work on some tidy 'minimalist code' that reproduces the fault and post it.
Never had these ADC problems before!

Regards Bill Legge in Australia

Bill Legge
Posts: 235
Joined: 28 Oct 2007 03:16
Location: West Australia

Re: PIC32 ADC Problem

#4 Post by Bill Legge » 11 Apr 2023 08:10

Many hours of fiddling with my code and ZERO progress!
Re-wrote minimalist code and -all OK.
'Added' the rest of the code in small chunks - all OK.

So, now I'm back to my original and it's all working.
Certainly wasn't the oscillator settings as RS232 and TFT worked OK.
All variables initialized.
Unfortunately, I did not keep a copy of the code that did not work!

Only thing that may have happened - once in a blue moon my PC (or compiler?) inserts a small, almost invisible character ` that stuffs up the code.
Thanks for your offer to investigate.

Regards Bill Legge in Australia.

User avatar
filip
mikroElektronika team
Posts: 11874
Joined: 25 Jan 2008 09:56

Re: PIC32 ADC Problem

#5 Post by filip » 13 Apr 2023 13:31

Hi,

Have you tried the default ADC example from the compiler ?

Regards,
Filip.

Bill Legge
Posts: 235
Joined: 28 Oct 2007 03:16
Location: West Australia

Re: PIC32 ADC Problem

#6 Post by Bill Legge » 14 Apr 2023 03:57

Filip - thanks for the suggestion.
The code example works OK and my own code also does now!
Nothing wrong with the compiler or hardware - just my poor coding.
Unfortunately I failed to identify my error during the re-write.
My project is to make and automated morse code transmitter and receiver.
The idea was to use the latest technology to mimic the oldest form of electronic communications.
I guess my great age is showing!
I'll publish it in the 'USER PROJECTS' section of the forum.

Regards Bill Legge in australia

Post Reply

Return to “mikroC PRO for PIC32 General”