Page 1 of 1

PIC16FL1939 Freezes with ADC component.

Posted: Sun Sep 30, 2012 2:00 pm
by medelec35
I believe this is also related to 16F1824 and 16F1827 that kept resetting when using ADC.
Attached is Flowchart (Thanks John Crow and Dan for RTC routines) to emulate (all except mtouch as that's not completed yet) the preloaded software on the Microchip One PIC Microcontroller Platform Demo board,

If ADC component is disabled (link pin 3 and 4 of ISSP ), then 16FL1939 runs indefinitely. Display keeps showing correct time from RTC
As soon as ADC component is re-enabled, RTC only Runs for a shot period of time then 16FL1939 freezes.

The only clue I have noticed is lowest ADC value shows as 30 when it should be 0

I have loaded the attached pic version and converted it for PIC24FJ256GA106 and loaded it into demo board.
Although there are other issues (I will post issues in VC section) , with ADC enabled PIC24FJ256GA106 runs without freezing at all.

If this gets solved ,it will be great since I could go back to 16F1827 with the fix :)

Martin

Re: PIC16FL1939 Freezes with ADC component.

Posted: Mon Oct 01, 2012 11:25 am
by Benj
Hi Martin,

Hm this is a wierd one. I have replicated your issue and the min ADC reading for me is 32. I am also getting the random crashes while the program is running.

I did change the acq time in the ADC properties page to 200 and this seemed to help the crashing issue. Also setting the Conv speed to /8 seemed to help but still not getting the full voltage range?

Re: PIC16FL1939 Freezes with ADC component.

Posted: Mon Oct 01, 2012 11:41 am
by medelec35
Hi Ben,
With 16F1xxx series i was experiencing resetting rather than crashes.
I can't help thinking its all related?
Could ADC component be accessing a wrong address?
It works as expected with original demo software at 32 MHz
Would you be able to tell from original assembly listing how ADC part workks as it appeasrs to be different to the standard ADC within 16F88 etc

Re: PIC16FL1939 Freezes with ADC component.

Posted: Sun Oct 07, 2012 7:25 pm
by medelec35
Here is an odd thing that I can't explain.

I have created a c component for ADC.
Using that ADC ranges from 0 to 1023.
However demo board still crashes.

If I copy and paste c code for ADC into demo board flowchart that ws posted in a different supply then instead of 0 it stars at 30.

Is there something conflicting with variables associated with ADC?

I have reduced osc speed to 8MHz just in case faster internal osc speed was causing an issue

Re: PIC16FL1939 Freezes with ADC component.

Posted: Mon Oct 08, 2012 2:39 pm
by Benj
Hi Martin,

I have just spent about an hour playing around with the board, the device datasheet and the ADC CAL and can't make head nor tail as to why the program is hanging. Still hanging for me and not resetting. Also my base ADC value is 32 so looks like there may be some kind of tolerance issue.

Could it possible be linked to the AAA battery. Have you tried powering using the PICkit whilst using sampling the analogue? I powered the board via the terminals on an EB064 the program now seems to run ok but the ADC reading is still stuck at a minimum of 32.

Could also have something to do with the cap touch pins? Maybe stray voltage getting onto the ADC cap. Might be worth outputting 0 to all the cap touch pins on startup to see if this helps at all.

Edit - program crashed at 00:01:24, Might be being cynical but maybe this is one reason why the board was so cheap :)

Re: PIC16FL1939 Freezes with ADC component.

Posted: Mon Oct 08, 2012 2:55 pm
by medelec35
Thanks for looking into this.

16F1xxx series would be great devices, if they weren’t so problematic. As yo know also has issues with 16F1824 and 16F1827.
Problems are not going to disappear with 16LF1839.
Benj wrote:Might be being synical but maybe this is one reason why the board was so cheap :) Could also have something to do with the cap touch pins? Maybe stray voltage getting onto the ADC cap. Might be worth outputting 0 to all the cap touch pins on startup to see if this helps at all.
I don’t think so, otherwise the same issue of 30 to 1023 would be present with microchip preloaded software and my One pic ADC test1 FC5.fcf
With One pic ADC test1 FC5.fcf that dispalys 0 to 1023 but still freezes. I placed wrong number in file comments. Should have been 0 to 1023 not 30 to 1023.
Just changed it.

I would love to do how microchip developed code so adc runs from 0 to 1023 and do not freeze.
Do any one at MM have a contact at microchip they can ask please?

Re: PIC16FL1939 Freezes with ADC component.

Posted: Tue Oct 09, 2012 9:38 am
by Benj
Hi Martin,

I will ask around and see if I can get through to anyone in the know. Great news on getting the full range. I will have a look at what you did and see if I can replicate here.

Re: PIC16FL1939 Freezes with ADC component.

Posted: Tue Oct 09, 2012 9:56 am
by medelec35
Thanks Ben,
But as stated in a previous post, although range is 0 to 1023
1) It still freezes chip.
2) Same code inserted into demo flowchart that displays RTC still causes range to vary between 30 and 1023.
The code preloaded when board is 1st purchased has none of the issues, so I’m wondering is it a variable or address conflict between Flowcode and newer 16F1xxx devices?
Have you saved a copy of original preloaded code?
If not I have got hex file I can post.

It would be great if this mystery could be solved, but I believe this is beyond my capabilities. :(