Flowcode compiling error PIC12F675

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 2 and 3.

Moderators: Benj, Mods

Post Reply
beejo
Posts: 31
Joined: Thu Sep 11, 2008 12:46 pm
Location: TheNetherlands
Has thanked: 4 times
Been thanked: 1 time

Flowcode compiling error PIC12F675

Post 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

User avatar
Steve
Matrix Staff
Posts: 3433
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times

Re: Flowcode compiling error PIC12F675

Post 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.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Flowcode compiling error PIC12F675

Post 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).

beejo
Posts: 31
Joined: Thu Sep 11, 2008 12:46 pm
Location: TheNetherlands
Has thanked: 4 times
Been thanked: 1 time

Re: Flowcode compiling error PIC12F675

Post 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?

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Flowcode compiling error PIC12F675

Post 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.

Post Reply