steiner wrote:Can you tell me what the width and heigth of the display is? How much do you want for it?
I am curious to know if the software that you sent me is the code that you had working properly on the bench. I am getting some strange results. When I first ran it, it was displaying that my cell was less than AbsMinCellVoltage. I then remed the code so the only thing that I have running in the "Main loop" is the "Check cells" and the "Display routine". I have the system stripped down to just the master and one slave. I have the number of cells set to 1. This particular cell measures 3.339 volts with a dmm. I also get a voltage reading of 1.231 volts across pins 6 and 8 on the slave. My calculations show the 10 bit A/D should be getting a reading of 377 (CellA). Plugging that into the equation gives CellV a value of 335 whick would be very close to the correct value. In the interrupt routine it subtracts 175 from CellV which would be 160 which is stored in b0 and b1.
If I understand the code correctly, the slave sends out "Vdata" which is the first byte (b0) of "CellV". The master brings this data in and stores it in the scratchpad ram. It then moves it to "VoltageData". I added a line of code to send "VoltageData" out to the LCD while it is still in the "Check Cells" routine. It is sending the ASCII code and I am getting 48. It then sends the High cell value to the LCD and I get 2.23 volts.
Can you explain how a value of 160 would be stored in two bytes? It would seem like 160 will fit in the first byte and therefore the second byte would be empty.
Rick
I don't think I ever tried the software with just 1 cell. I think you should try two as a minimum to start with.
CellV is a two byte word variable. By subtracting 175 from the ADC result in the slave we get a value which can fit into one byte and covers the working voltage range of the cell. Becasue the result is less than 255 we know it must be stored in byte b0 (The first byte of the word variable CellV) . That's why we only send one byte (VDATA b0) back to the master.
The master in the check cell routine loads the value into VoltageData a byte variable which is actually the first part of word variable CellVoltage.
The master does various checks and then adds back the value (175) that was taken off by the slave to recreate the correct cell voltage in the word variable CellVoltage.
Check the baud rate is the same in Master and Slave and that they are both running at 8mhz. (Setfreq M8)
I suggest post your modified code so we can look at it. sS you have changed the code it could have upset something? What lcd display are you using? How have you altered the display routine ?
You could modify the slave code to send a known test value say 200.
Loop1:
if pin3 = 1 then Loop1 ;Wait until interrupt signal is low before begining transmission
b0 = 200
low MasterBus ;Turn on MasterBus Optocoupler (Reqd due to sink driven)
You know the Master should then display 3.75v (200 + 175)
It does work but a bug could have slipped in, I haven't worked on the Master/Slave code for 6 months!
I don't know width height of display without removing it all from my setup, I just havent time at minute. It will be slightly smaller than the ones advertised on e-bay as it is minus the case.