retepsnikrep wrote:A bit of reverse logic reqd as it works backwards as well with higher numbers from ADC = lower cell voltages.
A spread sheet that worked out these values for you/us would be good. What I know about excel you can write on a full stop.
Or, even better a script that asked for the values you wanted and then output a program file. Possible, but a bit out of my league. If anyone wants to have a go, please do.
It might not work for the Digital Slaves as that only has one byte to transmit the cell voltage to the Master.
Also the Master would have to work a fair bit harder to re-create the actual voltages for display and calcuation purposes if it only got the raw adc data. At the moment it just performs a simple addition adding 175 to the the transmitted data to get the CellV. The Slaves do the donkey work and actually do the calculation of the CellV at present.
Your right, it is better to leave the digital slaves as they are.
Yes I think you can use this for your own application, but I think the actual cell voltages are easier to understand for the average punter. It would be easy to make a costly mistake
We may save a cpu few cycles and a few ua but it's quite a lot of effort.
Peter
I think the best compromise would to be to have the pic do the calculations. So you still have the section;
symbol MaxVOptoOn = 365
symbol MaxVOptoOff = 360
symbol LoadOn = 355
symbol LoadOff = 350
symbol MinVOptoOff = 260
symbol MinVOptoOn = 250
But then you recalculate the values;
symbol MaxVOptoOn = RefVADC/MaxVOptoOn * 2
Not sure if this is a valid statement, but you probably get the idea of what I am trying to do. Carry this out for all 6 values, but it only has to be done once. So you save a few cpu cycles and a few ua but it is still understandable for the average punter.