code for dual voltage 'window' on ADC input
Moderator: Benj
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: code for dual voltage 'window' on ADC input
Can you please give more detail of LED on and off durations in ms for all the conditions, including if board is under or over voltage for window + when adc is reading voltage is 30V.
Thanks.
Thanks.
Martin
-
- Posts: 139
- Joined: Mon Sep 21, 2009 10:17 am
- Location: Leicester
- Has thanked: 35 times
- Been thanked: 12 times
- Contact:
Re: code for dual voltage 'window' on ADC input
Hi Martin,
Completely understood on the risk and responsibility front..........it's all mine....no comebacks guaranteed.
Just can't thank you enough.
Any time you need hardware design or PCB design........I'm your man............t'would be good to return the favour some day.
Dave
Completely understood on the risk and responsibility front..........it's all mine....no comebacks guaranteed.
Just can't thank you enough.
Any time you need hardware design or PCB design........I'm your man............t'would be good to return the favour some day.
Dave
-
- Posts: 139
- Joined: Mon Sep 21, 2009 10:17 am
- Location: Leicester
- Has thanked: 35 times
- Been thanked: 12 times
- Contact:
Re: code for dual voltage 'window' on ADC input
Hi Martin, the timings are not critical.
All I need is easily differentiated pulsing for the various conditions.
The only definite is the standby phase, when supply voltage is below operational window, i.e. outside the the upper or lower acceptable ranges. To explain......The circuit must assume the vehicle (could be 12v or 24v vehicle) is stationary without engine running and go into standby state using minimum current (not draining the battery!) but still indicating it's alive and ready. So.......a slowly flashing led. just like an auto alarm would do.
The other must have is a rapid flash when over temperature by, say, 10 degrees...........something very noticeable like 5hz or so. This is to alert the user that the water may be too hot - scald risk! or that the tank is empty and the heater is overheating (There is a thermal fuse that shuts the whole circuit down, permanently! in a thermal runaway emergency. Apart from the rapid flashing warning, which should continue, this can be ignored programatically as in this event.....it's back to the factory for a new fuse.)
I reckon a solid ON when below temperature and heater energised and an even say, 1hz flash when at temperature. - or vise-verso.
I would have temperature upper limit of 45c at which point, heater switches off and doesn't come back on again until temperature has dropped by 5c. This to give some hysteresis to the thermal control loop. A small over/undershoot won't be significant.
I thought about the supply voltage out of range indication and decided this is not actually necessary..........it is only necessary to stop the heater function when out of range. The in range, solid or 1hz flash will indicate normal range and normal operation.
Hope this helps highlight what's needed.
Boards are being built now so here's hoping they work.....
Cheers
Dave
All I need is easily differentiated pulsing for the various conditions.
The only definite is the standby phase, when supply voltage is below operational window, i.e. outside the the upper or lower acceptable ranges. To explain......The circuit must assume the vehicle (could be 12v or 24v vehicle) is stationary without engine running and go into standby state using minimum current (not draining the battery!) but still indicating it's alive and ready. So.......a slowly flashing led. just like an auto alarm would do.
The other must have is a rapid flash when over temperature by, say, 10 degrees...........something very noticeable like 5hz or so. This is to alert the user that the water may be too hot - scald risk! or that the tank is empty and the heater is overheating (There is a thermal fuse that shuts the whole circuit down, permanently! in a thermal runaway emergency. Apart from the rapid flashing warning, which should continue, this can be ignored programatically as in this event.....it's back to the factory for a new fuse.)
I reckon a solid ON when below temperature and heater energised and an even say, 1hz flash when at temperature. - or vise-verso.
I would have temperature upper limit of 45c at which point, heater switches off and doesn't come back on again until temperature has dropped by 5c. This to give some hysteresis to the thermal control loop. A small over/undershoot won't be significant.
I thought about the supply voltage out of range indication and decided this is not actually necessary..........it is only necessary to stop the heater function when out of range. The in range, solid or 1hz flash will indicate normal range and normal operation.
Hope this helps highlight what's needed.
Boards are being built now so here's hoping they work.....
Cheers
Dave
-
- Posts: 139
- Joined: Mon Sep 21, 2009 10:17 am
- Location: Leicester
- Has thanked: 35 times
- Been thanked: 12 times
- Contact:
Re: code for dual voltage 'window' on ADC input
Hi Martin,
I see your recommendation for using 12F617 and I'm all for it, not least because it's cheaper but particularly for it's greater flash capacity. Problem is, PICKIT 2 doesn't support this chip.....unless you know better.
There is some talk on forums, about creating a pickit2 header file for use with 617 but how the hell does one do this?
I'd be very reluctant to buy another programmer when the one i've got works fine....sure you see my point. but hey, if that's what it takes then........
Dave
I see your recommendation for using 12F617 and I'm all for it, not least because it's cheaper but particularly for it's greater flash capacity. Problem is, PICKIT 2 doesn't support this chip.....unless you know better.
There is some talk on forums, about creating a pickit2 header file for use with 617 but how the hell does one do this?
I'd be very reluctant to buy another programmer when the one i've got works fine....sure you see my point. but hey, if that's what it takes then........
Dave
-
- Posts: 139
- Joined: Mon Sep 21, 2009 10:17 am
- Location: Leicester
- Has thanked: 35 times
- Been thanked: 12 times
- Contact:
Re: code for dual voltage 'window' on ADC input
ermmmm...ignore my last post !
I've been stupid and didn't read the forums properly.......I have now downloaded the latest definition files for Pickit 2 and hey presto....12F617 is now in the supported devices list......voila!!
I have also just ordered a bunch of 617's from Farnell.
My only concern is the ADC loading, the 675 seems to have better tolerance for higher impedance sources than the 617.............but maybe I'm either reading it wrong or it doesn't matter a great deal.
Apparently, it's more important to allow a sufficient acquisition time.......which we can do because we're running a very slow app.......right?
Dave
I've been stupid and didn't read the forums properly.......I have now downloaded the latest definition files for Pickit 2 and hey presto....12F617 is now in the supported devices list......voila!!
I have also just ordered a bunch of 617's from Farnell.
My only concern is the ADC loading, the 675 seems to have better tolerance for higher impedance sources than the 617.............but maybe I'm either reading it wrong or it doesn't matter a great deal.
Apparently, it's more important to allow a sufficient acquisition time.......which we can do because we're running a very slow app.......right?
Dave
- Enamul
- Posts: 1772
- Joined: Mon Mar 05, 2012 11:34 pm
- Location: Nottingham, UK
- Has thanked: 271 times
- Been thanked: 814 times
- Contact:
Re: code for dual voltage 'window' on ADC input
Hi,
http://www.microchip.com/stellent/idcpl ... e=en027813
- Use AC162083 ICD header & AC164110 adapter.
Even if you need the special ICD header its pretty easy to make one..if you think you want to make a try please let us know..we can help you.
Enamul
It does support PIC12f617....as according to the link..I see your recommendation for using 12F617 and I'm all for it, not least because it's cheaper but particularly for it's greater flash capacity. Problem is, PICKIT 2 doesn't support this chip.....unless you know better.
http://www.microchip.com/stellent/idcpl ... e=en027813
PIC12F615*, HV615*There is some talk on forums, about creating a pickit2 header file for use with 617 but how the hell does one do this?
- Use AC162083 ICD header & AC164110 adapter.
Even if you need the special ICD header its pretty easy to make one..if you think you want to make a try please let us know..we can help you.
Enamul
- Enamul
- Posts: 1772
- Joined: Mon Mar 05, 2012 11:34 pm
- Location: Nottingham, UK
- Has thanked: 271 times
- Been thanked: 814 times
- Contact:
Re: code for dual voltage 'window' on ADC input
Hi,
Enamul
As Martin said, you can use 617 in 8MHz speed just using internal clock whereas 675 maximum 4 MHz using internal clock..so you have 2x speed gain in any peripherals which is true for ADC as well. So I don't feel any problem in using 617 than 675...the only issue is EEPROM which you can get in 675 but not in 617 whereas in 617 with higher memory and double speed you will get CCP module..My only concern is the ADC loading, the 675 seems to have better tolerance for higher impedance sources than the 617.............but maybe I'm either reading it wrong or it doesn't matter a great deal.
Apparently, it's more important to allow a sufficient acquisition time.......which we can do because we're running a very slow app.......right?
Enamul
-
- Posts: 139
- Joined: Mon Sep 21, 2009 10:17 am
- Location: Leicester
- Has thanked: 35 times
- Been thanked: 12 times
- Contact:
Re: code for dual voltage 'window' on ADC input
Hi again............it's getting late and I'm talking dumb again re: impedances..........both devices have virtually the same spec.
Duhh.......g'night all
Dave
Duhh.......g'night all
Dave
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: code for dual voltage 'window' on ADC input
Hi David,
Here is my 1st attempt utilising your given specifications.
Target device = 12F617.
If It works then final step is enabling watchdog timer.
But its not just a case of enabling, so we can go through that when your ready.
Martin
Here is my 1st attempt utilising your given specifications.
Target device = 12F617.
If It works then final step is enabling watchdog timer.
But its not just a case of enabling, so we can go through that when your ready.
Martin
- Attachments
-
- Dual voltage window 4.fcf
- (21.17 KiB) Downloaded 329 times
Martin
-
- Posts: 139
- Joined: Mon Sep 21, 2009 10:17 am
- Location: Leicester
- Has thanked: 35 times
- Been thanked: 12 times
- Contact:
Re: code for dual voltage 'window' on ADC input
Hi Martin,
Thanks again for the code !!
I am having trouble simulating it though.
The LED currently marked 'over voltage' is not leaving the slow, 'standby' led mode of long off - short on except when over voltage or low voltage.
Maybe I wasn't clear in my synopsis. In any case, it would be great if I understood the flowchart so I could utilise this code as a baseline to do my own tweaks........unfortunately, much of it loses me..!?
I'll try and clarify what's needed graphically...not sure how yet....going to think about it.
Dave
Thanks again for the code !!
I am having trouble simulating it though.
The LED currently marked 'over voltage' is not leaving the slow, 'standby' led mode of long off - short on except when over voltage or low voltage.
Maybe I wasn't clear in my synopsis. In any case, it would be great if I understood the flowchart so I could utilise this code as a baseline to do my own tweaks........unfortunately, much of it loses me..!?
I'll try and clarify what's needed graphically...not sure how yet....going to think about it.
Dave
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: code for dual voltage 'window' on ADC input
Hi Dave
This is because I have used LUT for thermistor to determine water temperature and LUT uses C code and as you may or may not be aware of C can't be simulated. The simulator will just think the water temperature is permanently at 0 deg C
So the over heat and at correct temperature conditions will never be met
Two options are 1) Use real pic simulator
Take a look here:
http://www.matrixmultimedia.com/mmforum ... 01&#p24998
Full version is good value for money, link for it is a few posts down.
2) Test on real hardware.
Flowchart gets a bit complex since there is one LED for indicating, and 5 different conditions. Some conditions call for two different patterns at the dame time, e.g normal voltage, water at correct temperature, or normal voltage and over heat. In these cases there has to be a priority.
It would be much easier (for determine board status and for flowchart simplicity) if you had two LED'S, one for voltage indication and the other for water temperature indication.
Unless you have and I misread your posts?
You only have two options as code can't simulated in Flowcode.daveb0360 wrote:I am having trouble simulating it though.
This is because I have used LUT for thermistor to determine water temperature and LUT uses C code and as you may or may not be aware of C can't be simulated. The simulator will just think the water temperature is permanently at 0 deg C
So the over heat and at correct temperature conditions will never be met
Two options are 1) Use real pic simulator
Take a look here:
http://www.matrixmultimedia.com/mmforum ... 01&#p24998
Full version is good value for money, link for it is a few posts down.
2) Test on real hardware.
I only was using 1 LED for all the different indications, was that not correct, since you marked it as 'over voltage'daveb0360 wrote: The LED currently marked 'over voltage' is not leaving the slow, 'standby' led mode of long off - short on except when over voltage or low voltage.
Flowchart gets a bit complex since there is one LED for indicating, and 5 different conditions. Some conditions call for two different patterns at the dame time, e.g normal voltage, water at correct temperature, or normal voltage and over heat. In these cases there has to be a priority.
It would be much easier (for determine board status and for flowchart simplicity) if you had two LED'S, one for voltage indication and the other for water temperature indication.
Unless you have and I misread your posts?
Martin
-
- Posts: 139
- Joined: Mon Sep 21, 2009 10:17 am
- Location: Leicester
- Has thanked: 35 times
- Been thanked: 12 times
- Contact:
Re: code for dual voltage 'window' on ADC input
Hi Martin,
I've put a graphic together to illustrate.
I have an old board with the previous hardware that I can try the code on until I have chance (time) to build one of the new ones with the 617 chip on board. So I will try this code in the 675 based old board tomorrow.
(I have a job on the bench for a customer that must come first!......it's late so must crack on with it)
I don't think we need to indicate specifically, any over voltage state...this is hardware protected......just a general 'out of range' (standby) state where no heater activity will be allowed.
I will need to know which variables to 'tweak' to make the hardware perform within real world values and tolerances.
Cheers
Dave
I've put a graphic together to illustrate.
I have an old board with the previous hardware that I can try the code on until I have chance (time) to build one of the new ones with the 617 chip on board. So I will try this code in the 675 based old board tomorrow.
(I have a job on the bench for a customer that must come first!......it's late so must crack on with it)
I don't think we need to indicate specifically, any over voltage state...this is hardware protected......just a general 'out of range' (standby) state where no heater activity will be allowed.
I will need to know which variables to 'tweak' to make the hardware perform within real world values and tolerances.
Cheers
Dave
- Attachments
-
- HeaterSeq.PNG
- Graphic of operation and led sequencing for differing states.
- (51.83 KiB) Downloaded 3468 times
- Enamul
- Posts: 1772
- Joined: Mon Mar 05, 2012 11:34 pm
- Location: Nottingham, UK
- Has thanked: 271 times
- Been thanked: 814 times
- Contact:
Re: code for dual voltage 'window' on ADC input
Nice depiction...if Martin delays in FC..I will post one for you...
Enamul
Enamul
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: code for dual voltage 'window' on ADC input
Yes that is much better Dave!
So much easier to follow
Martin
So much easier to follow
Ok, I will post my updated one after you have posted yours.Enamul wrote:if Martin delays in FC..I will post one for you...
Enamul
Martin
Martin
-
- Posts: 139
- Joined: Mon Sep 21, 2009 10:17 am
- Location: Leicester
- Has thanked: 35 times
- Been thanked: 12 times
- Contact:
Re: code for dual voltage 'window' on ADC input
Hi Martin,
This is being developed to replace an obsolete control board for a customer. He is limited to a single led as all his brochures, metalwork etc. is in stock and not cost effective to modify for a second led.
The voltage measurement only serves to allow or disallow the heater activity.
If voltages are in range, the heater control loop will activate and the differing led patterns of a functioning temperature control loop will indicate normal working.
There are only 4 led patterns.
1. Slow, uneven blink....long off-short on. Standby condition - waiting for supply voltage to be in range - Heating control disabled and heater OFF.
2. Even - ~0.5sec blink. Water under temperature and actively heating - supply voltage determined to be within one of the working ranges
3. Constant on. Water at working temperature (40-45c) - NOT actively heating but supply voltage determined to be within one of the working ranges
4. Rapid Blink. Water temperature exceeded normal +10c This rapid blinking must remain active, even if supply voltage falls out of range but revert to the standby condition if water temp falls back to normal.
This means, effectively, the temperature monitoring circuit must be a continuous process - even in standby OR, once overtemp has been detected, it continues to signal the alarm until temperature falls back to normal and then goes to standby indication as normal.
Reason for this is simply that a user need to know the possible risk of harm even when the vehicle has been switched off.........any overhot water, may remain overhot for some time after the engine is switched off.
Any excursions away from normal supply voltages, must override the heater to a default OFF state in all conditions.
I feel I must apologise now as I haven't been very clear and should have given this more thought before I asked for help !
I would completely understand if you throw in the towel! -:(
Hopefully it is all clear now........it is finally in my own mind!
Dave
This is being developed to replace an obsolete control board for a customer. He is limited to a single led as all his brochures, metalwork etc. is in stock and not cost effective to modify for a second led.
The voltage measurement only serves to allow or disallow the heater activity.
If voltages are in range, the heater control loop will activate and the differing led patterns of a functioning temperature control loop will indicate normal working.
There are only 4 led patterns.
1. Slow, uneven blink....long off-short on. Standby condition - waiting for supply voltage to be in range - Heating control disabled and heater OFF.
2. Even - ~0.5sec blink. Water under temperature and actively heating - supply voltage determined to be within one of the working ranges
3. Constant on. Water at working temperature (40-45c) - NOT actively heating but supply voltage determined to be within one of the working ranges
4. Rapid Blink. Water temperature exceeded normal +10c This rapid blinking must remain active, even if supply voltage falls out of range but revert to the standby condition if water temp falls back to normal.
This means, effectively, the temperature monitoring circuit must be a continuous process - even in standby OR, once overtemp has been detected, it continues to signal the alarm until temperature falls back to normal and then goes to standby indication as normal.
Reason for this is simply that a user need to know the possible risk of harm even when the vehicle has been switched off.........any overhot water, may remain overhot for some time after the engine is switched off.
Any excursions away from normal supply voltages, must override the heater to a default OFF state in all conditions.
I feel I must apologise now as I haven't been very clear and should have given this more thought before I asked for help !
I would completely understand if you throw in the towel! -:(
Hopefully it is all clear now........it is finally in my own mind!
Dave
- Attachments
-
- HeaterSeq.PNG
- (51.83 KiB) Downloaded 3465 times
-
- Posts: 139
- Joined: Mon Sep 21, 2009 10:17 am
- Location: Leicester
- Has thanked: 35 times
- Been thanked: 12 times
- Contact:
Re: code for dual voltage 'window' on ADC input
With all this help on offer.....I'm never gonna learn....lolEnamul wrote:Nice depiction...if Martin delays in FC..I will post one for you...
Enamul
Actually...not quite true, whilst I'm not ready to embark on this relatively complex task.........I'm studying what you guys are presenting me with and learning piecemeal........so double thanks.
No doubt if I had a few weeks to get this done, I'd probably get it by reading the lits and picking up tips from this forum........unfortunately.......I don't have time, customer is hoping to pick up working proto's on Friday......
Dave
- Enamul
- Posts: 1772
- Joined: Mon Mar 05, 2012 11:34 pm
- Location: Nottingham, UK
- Has thanked: 271 times
- Been thanked: 814 times
- Contact:
Re: code for dual voltage 'window' on ADC input
Hi,
I have spent couple of hours to check your requirements and design the FC using temperature portion from Martin as his LUT is great for Thermistor temperature measurement. I don't have this chip to test in hardware..but you can test obviously in hardware...please let me know how it's going.
Enamul
I have spent couple of hours to check your requirements and design the FC using temperature portion from Martin as his LUT is great for Thermistor temperature measurement. I don't have this chip to test in hardware..but you can test obviously in hardware...please let me know how it's going.
Enamul
- Attachments
-
- Water_Heater_Control.fcf
- (14.34 KiB) Downloaded 264 times
- Enamul
- Posts: 1772
- Joined: Mon Mar 05, 2012 11:34 pm
- Location: Nottingham, UK
- Has thanked: 271 times
- Been thanked: 814 times
- Contact:
Re: code for dual voltage 'window' on ADC input
Hi,
I have just simulated in Real PIC...there are couple of problems in last posted version...I am correcting those...Almost done..I will post soon..Can you please download FCV5 free version from the link...as seems ADC problem in FCV4 in this chip...You can easily compile the pg in fcv5..
http://www.matrixmultimedia.com/lc_index.php?p=25
Enamul
I have just simulated in Real PIC...there are couple of problems in last posted version...I am correcting those...Almost done..I will post soon..Can you please download FCV5 free version from the link...as seems ADC problem in FCV4 in this chip...You can easily compile the pg in fcv5..
http://www.matrixmultimedia.com/lc_index.php?p=25
Enamul
- Enamul
- Posts: 1772
- Joined: Mon Mar 05, 2012 11:34 pm
- Location: Nottingham, UK
- Has thanked: 271 times
- Been thanked: 814 times
- Contact:
Re: code for dual voltage 'window' on ADC input
Hi,
Here is the V5 version. I have tested this in Real PIC Simulator...works excellent. I have posted hex so that you can try in hardware...
Hope this helps.
Here is the V5 version. I have tested this in Real PIC Simulator...works excellent. I have posted hex so that you can try in hardware...
Hope this helps.
- Attachments
-
- Water_Heater_Control.hex
- (3.11 KiB) Downloaded 232 times
-
- Water_Heater_Control.fcf
- (23.27 KiB) Downloaded 261 times
-
- Posts: 139
- Joined: Mon Sep 21, 2009 10:17 am
- Location: Leicester
- Has thanked: 35 times
- Been thanked: 12 times
- Contact:
Re: code for dual voltage 'window' on ADC input
Hi Enamul,
Problem with this instruction....
I tried the code in Real Pic sim and as you say, seems to work fine.......
I am building the boards in a while, now I've finished my assembly job, and will build with the f617 as Martin suggested.
Can't believe you sat up so late/early doing this for me, Both you and Martin are utter stars.....I applaud you !.. (I too, worked through the night to get the assy job done so I know how tired you must be right now.....I can't do any more than thank you......but it's a big thanks..
Dave
Problem with this instruction....
The demo/free version doesn't support the chip we're using and I don't have the budget at the mo for the full upgrade....I'd be more comfortable with the file in v4 format.Enamul wrote:Hi,
I have just simulated in Real PIC...there are couple of problems in last posted version...I am correcting those...Almost done..I will post soon..Can you please download FCV5 free version from the link...as seems ADC problem in FCV4 in this chip...You can easily compile the pg in fcv5..
http://www.matrixmultimedia.com/lc_index.php?p=25
Enamul
I tried the code in Real Pic sim and as you say, seems to work fine.......
I am building the boards in a while, now I've finished my assembly job, and will build with the f617 as Martin suggested.
Can't believe you sat up so late/early doing this for me, Both you and Martin are utter stars.....I applaud you !.. (I too, worked through the night to get the assy job done so I know how tired you must be right now.....I can't do any more than thank you......but it's a big thanks..
Dave
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: code for dual voltage 'window' on ADC input
Hi Dave,
Here is my modified version.
Voltage and temperature readings are taken all the time and there must not be any voltage deviation for a continuous time of 2 seconds.
Formula for voltage changed to use a direct voltage value e.g. 16=16V etc.
Also using status picture, modified so should be as picture. E.g. Heater is active only when thermistor is lower than 40C and Voltage is within correct parameters.
Martin
Here is my modified version.
Voltage and temperature readings are taken all the time and there must not be any voltage deviation for a continuous time of 2 seconds.
Formula for voltage changed to use a direct voltage value e.g. 16=16V etc.
Also using status picture, modified so should be as picture. E.g. Heater is active only when thermistor is lower than 40C and Voltage is within correct parameters.
Martin
- Attachments
-
- Dual voltage window5.fcf
- (21.47 KiB) Downloaded 266 times
Martin
- Enamul
- Posts: 1772
- Joined: Mon Mar 05, 2012 11:34 pm
- Location: Nottingham, UK
- Has thanked: 271 times
- Been thanked: 814 times
- Contact:
Re: code for dual voltage 'window' on ADC input
Hi,
Sorry I should remember that FCV5 demo has some limitation....I was sleepy I guess....
Enamul
Sorry I should remember that FCV5 demo has some limitation....I was sleepy I guess....
Actually, this line you posted made me to wake till so late...as you really need support...for this project if you still feel any modification needed you can tell me I will modify that one and send you a hex..Of course we welcome you V5+ version whenever you become sound.I don't have time, customer is hoping to pick up working proto's on Friday......
Enamul
- Enamul
- Posts: 1772
- Joined: Mon Mar 05, 2012 11:34 pm
- Location: Nottingham, UK
- Has thanked: 271 times
- Been thanked: 814 times
- Contact:
Re: code for dual voltage 'window' on ADC input
Hi,
I have checked this one using Real PIC simulator...it works fine..this is in FCV4..so I guess last time in V4 problem is just because of late working..
You can change if needed..as this is in FCV4
Enamul
I have checked this one using Real PIC simulator...it works fine..this is in FCV4..so I guess last time in V4 problem is just because of late working..
You can change if needed..as this is in FCV4
Enamul
- Attachments
-
- Water_Heater_Control.fcf
- FCV4 version
- (14.34 KiB) Downloaded 249 times
-
- Posts: 139
- Joined: Mon Sep 21, 2009 10:17 am
- Location: Leicester
- Has thanked: 35 times
- Been thanked: 12 times
- Contact:
Re: code for dual voltage 'window' on ADC input
Hi Enamul,
Thanks again.........pleased to say, hardware is working perfectly.....absolutely no issues with the hardware...yeehaaaa.
The code has a problem though.
When I try to compile to HEX I get the following warnings.
Warning unreferenced functions removed:
FCI_FLOAT_TO_STRING in: C:\Program Files (x86)\Matrix Multimedia\Flowcode V4\FCD\internals.h
FCI_NUMBER_TO_HEX in: C:\Program Files (x86)\Matrix Multimedia\Flowcode V4\FCD\internals.h
FCI_STRING_TO_INT in: C:\Program Files (x86)\Matrix Multimedia\Flowcode V4\FCD\internals.h
FCI_STRING_TO_FLOAT in: C:\Program Files (x86)\Matrix Multimedia\Flowcode V4\FCD\internals.h
Wdt_Delay_S in: C:\Program Files (x86)\Matrix Multimedia\Flowcode V4\FCD\internals.h
Wdt_Delay_Ms in: C:\Program Files (x86)\Matrix Multimedia\Flowcode V4\FCD\internals.h
isinf in: C:\Program Files (x86)\Matrix Multimedia\Flowcode V4\FCD\internals.h
FCD_ADC0_ReadAsByte in: C:\Users\Dave\AppData\Local\Temp\Water_Heater_Control.c
FCD_ADC0_ReadAsVoltage in: C:\Users\Dave\AppData\Local\Temp\Water_Heater_Control.c
FCD_ADC0_ReadAsString in: C:\Users\Dave\AppData\Local\Temp\Water_Heater_Control.c
FCD_ADC1_ReadAsInt in: C:\Users\Dave\AppData\Local\Temp\Water_Heater_Control.c
FCD_ADC1_ReadAsVoltage in: C:\Users\Dave\AppData\Local\Temp\Water_Heater_Control.c
FCD_ADC1_ReadAsString in: C:\Users\Dave\AppData\Local\Temp\Water_Heater_Control.c
Have you any Idea what might be the problem?
Dave
Thanks again.........pleased to say, hardware is working perfectly.....absolutely no issues with the hardware...yeehaaaa.
The code has a problem though.
When I try to compile to HEX I get the following warnings.
Warning unreferenced functions removed:
FCI_FLOAT_TO_STRING in: C:\Program Files (x86)\Matrix Multimedia\Flowcode V4\FCD\internals.h
FCI_NUMBER_TO_HEX in: C:\Program Files (x86)\Matrix Multimedia\Flowcode V4\FCD\internals.h
FCI_STRING_TO_INT in: C:\Program Files (x86)\Matrix Multimedia\Flowcode V4\FCD\internals.h
FCI_STRING_TO_FLOAT in: C:\Program Files (x86)\Matrix Multimedia\Flowcode V4\FCD\internals.h
Wdt_Delay_S in: C:\Program Files (x86)\Matrix Multimedia\Flowcode V4\FCD\internals.h
Wdt_Delay_Ms in: C:\Program Files (x86)\Matrix Multimedia\Flowcode V4\FCD\internals.h
isinf in: C:\Program Files (x86)\Matrix Multimedia\Flowcode V4\FCD\internals.h
FCD_ADC0_ReadAsByte in: C:\Users\Dave\AppData\Local\Temp\Water_Heater_Control.c
FCD_ADC0_ReadAsVoltage in: C:\Users\Dave\AppData\Local\Temp\Water_Heater_Control.c
FCD_ADC0_ReadAsString in: C:\Users\Dave\AppData\Local\Temp\Water_Heater_Control.c
FCD_ADC1_ReadAsInt in: C:\Users\Dave\AppData\Local\Temp\Water_Heater_Control.c
FCD_ADC1_ReadAsVoltage in: C:\Users\Dave\AppData\Local\Temp\Water_Heater_Control.c
FCD_ADC1_ReadAsString in: C:\Users\Dave\AppData\Local\Temp\Water_Heater_Control.c
Have you any Idea what might be the problem?
Dave
- Enamul
- Posts: 1772
- Joined: Mon Mar 05, 2012 11:34 pm
- Location: Nottingham, UK
- Has thanked: 271 times
- Been thanked: 814 times
- Contact:
Re: code for dual voltage 'window' on ADC input
Hi,
you can see here...
As long as you get success returned at the bottom of msg don't need to worry..
Enamul
This is not a problem...this is normally done by FC compiling...for example if you use ADC in your c code all the adc macros are copied but you might have use one macro. Rest are unnecessary for your program and if converted to hex will just unnecessarily occupy lots of space in memory...That's why FC removes this and just make a warning..The code has a problem though.
When I try to compile to HEX I get the following warnings.
Warning unreferenced functions removed:
you can see here...
it doesn't say warn for FCD_ADC0_ReadAsInt as we used INT read for ADC0FCD_ADC0_ReadAsByte in: C:\Users\Dave\AppData\Local\Temp\Water_Heater_Control.c
FCD_ADC0_ReadAsVoltage in: C:\Users\Dave\AppData\Local\Temp\Water_Heater_Control.c
FCD_ADC0_ReadAsString in: C:\Users\Dave\AppData\Local\Temp\Water_Heater_Control.c
But for ADC1 warn for INT read not for Byte read as we used Byte read...FCD_ADC1_ReadAsInt in: C:\Users\Dave\AppData\Local\Temp\Water_Heater_Control.c
FCD_ADC1_ReadAsVoltage in: C:\Users\Dave\AppData\Local\Temp\Water_Heater_Control.c
FCD_ADC1_ReadAsString in: C:\Users\Dave\AppData\Local\Temp\Water_Heater_Control.c
As long as you get success returned at the bottom of msg don't need to worry..
Enamul