Index: /webserver/example/EnergyMeters/Source/EnergyMeters/SolarCountUART.c =================================================================== --- /webserver/example/EnergyMeters/Source/EnergyMeters/SolarCountUART.c (revision 74) +++ /webserver/example/EnergyMeters/Source/EnergyMeters/SolarCountUART.c (revision 75) @@ -1403,10 +1403,25 @@ req_hour_yield[5] = 0x30 + channel; // channel - - hourMSB = hour % 16; - hourLSB = hour - hourMSB; + if (hour >= 0x10) /* >= 16 */ + { + hourMSB = 1; + } + else + { + hourMSB = 0; + } + hourLSB = hour - (hourMSB * 0x10); + + if (hourLSB <= 9) + { + req_hour_yield[9] = 0x30 + hourLSB; // minute LSB (binary coded hex) + } + else + { + req_hour_yield[9] = 0x40 + hourLSB - 0xA; // minute LSB (binary coded hex, 0xA --> 0x40, 0xF -> 0x45) + } - req_hour_yield[8] = 0x30 + hourMSB; // minute MSB (binary coded hex) - req_hour_yield[9] = 0x30 + hourLSB; // minute LSB (binary coded hex) + req_hour_yield[8] = 0x30 + hourMSB; // minute MSB (binary coded hex), 30 or 31 here. + newChkSum = calculate_crc8( (&(req_hour_yield[0])), (sizeof(req_hour_yield)-1));