Page 1 of 1

Flowcode compiling error PIC12F675

Posted: Thu Sep 11, 2008 3:33 pm
by beejo
Hi,
With Flowcode i try to make an temperature-limitter with an NTC resistor in an alu coolblock of an Darlington transistor. I use an PIC12F675 chip whith the internal oscillator set on 4 MHZ.
First with the TMR0 interrupt i call the ADC(0) macro to sample the Pic on GP0. Then i read the value as integer., In a decionblock this value is compared. When the temperature is to high the power function will be switched off and a warning led will start to flash in a endles loop. In simulation mode it works nice but whithin each time i try to compile to the chip i get the folowing message:

Warning unreferenced functions removed:
FCD_ADC0_ReadAsByte in: D:\Joh\Pic controller\flowcode\FLC200806001tempcontroltest-.c

Building CASM file
Serious Warning: Possible sw stack corruption, function 'delay_ms' called by more than one asynchronous thread (main/Task, interrupt, interrupt low)


What did i wrong?
After some attempt 's the Pic controller does not respond anymore. Within PPP i erased the PIC and have tryed to compile again without any result.
Is there a wrong value in some register or is he really gone?
Thanks in advance,
Beejo

Re: Flowcode compiling error PIC12F675

Posted: Thu Sep 11, 2008 3:56 pm
by Steve
This is saying the delay function is used within the main program and also in the interrupt service routine. You should avoid this.

It is best to make your ISR as quick as possible, so I would suggest redoing your program so that all delays occur in the main program and not in the ISR.

Re: Flowcode compiling error PIC12F675

Posted: Thu Sep 11, 2008 4:36 pm
by Benj
Hello

The best way to check if your PIC is working is to create a very simple program to toggle an LED inside an infinite loop.

Make sure your Oscillator settings are correct in the Chip -> Configuration window, Make sure your speed setting is correct in the Chip -> Clock speed window and make sure that the hardware matches your oscillator configuration eg RC or XT or HS (expert mode - crystals over 4MHz).

Re: Flowcode compiling error PIC12F675

Posted: Mon Sep 15, 2008 2:24 pm
by beejo
Hi Steve,
Thank you for the quick response. I follow up your advice and yes it works thank you.

I notice another problem, maybe the cause of the malfunction of the Pic12f675 chips?
I connected a NTC resistor of 1kohm/25ΒΊC and a resistor of 270 ohm in serie as voltage divider between the 5V and the ground.
The junction of the two resistors came to the input Gp0. The Pic did his normal program but did not respond on the temperature differences caused by a heat gun. I measured a voltage on GP0 >> than 1V in all circumstances (Had to be slightly over 1V at 25ΒΊC). Then I used an new Pic 12F675 and a resistor of 1kohm instead of 270ohm. With the same program the Pic reacted immediately at room temperature. So this works. The other Pic does not respond on GP0. Now the question:Is it possible that these resistor value(270ohm) is critical and have damaged the inputGp0?

Re: Flowcode compiling error PIC12F675

Posted: Mon Sep 15, 2008 5:18 pm
by Benj
Hello Beejo

It seems unlikly that you will have damaged your device by using the 270 Ohm resistor. We use a 220 ohm resistor here for all our E-Blocks to avoid damaging the microcontrollers. Aswell as this the microcontrollers are tough little devices and you will be pushed to acutally damage an I/O pin without forcably trying to. Are you sure that there are no other differences between the two chips.