05-19-2017 01:52 AM
Hello,
We have an application in which we have to monitor a serial protocol between a battery management control system and modules that transfers information of voltage,current,and the temperature of each cell in the battery pack .There's no information available about the protocol, this is propietary information of the manufacturer.the intention of the project is to replace the BMS with PlC,so I need to decode this serial protocol.
Finally I measure the baudrate which is 8928,and I used a piece code in Matlab so I collect the transfered data from modules to the controller.all of them are decimal numbers,or when I change int to char ,I can see some not readable data.,anybody have any suggestion how to find out some valuable information from these codes? I do not have any information about parity and stop bit but I also will try to find something by changing them randomely, and see the results.I just think that by chaging and discharging the battery and see the changes on these values maybe I can recogoniyed the relation between those values and the temperature,voltage an current.
thanks
elham
05-22-2017 02:01 AM
Hi Elham,
If you can receive the data without any errors you now that the parity and baudrate are OK. Although 8928 baud ?!?
It would help if you post a piece of the data here.
Kees
05-22-2017 02:01 AM - edited 05-22-2017 02:02 AM
05-22-2017 02:27 AM
Hi,
unfortunately when I try to read char data they are not readable data ,so I am not really sure that would be the correct one.But,I measure with the oscilloscope many times the minimum width of the signal is 120 microseconds so the baudrate is 8928 but I also try the nearest standard buadrate 9600 but those data were not readable too.here you can see the collected data with another software.moreover ,Im not sure about the parity and the stop bit but I try to change them and I found nothing.
05-22-2017 07:05 AM
There are a number of settings other than baudrate.
This does not fully capture all options above. If you read 7-E-1 or 7E1 in the document, that would infer 7-bits with Even parity and one stop bit. Also, if there is no information on flow control, default to no flow control.
05-22-2017 07:14 AM
I know but unfortunatelly there is no information about them.
05-22-2017 09:19 AM
You can forget the number of stopbits. The UART will take care of this. But to make it more complex the number of data bits could also be 9 !! or whatever.
If you connect it to a COM port at 9600 what kind of error do you get ? If you get different errors and framing errors probably the speed or number of bits are wrong. Try 9600 baud and different databits and look at the errors. Do the same for the speed you think it should be.
Once you receive only parity errors your almost there.
Just some thoughts
05-22-2017 09:26 AM
Ok thank you for your help,I will try to do so.
05-22-2017 09:27 AM
There's no information available about the protocol, this is propietary information of the manufacturer.the intention of the project is to replace the BMS with PlC,so I need to decode this serial protocol.
Seeing how this is a proprietary coding, it may be that they have encoded the bus. This means that you will need to do a whole lot more sleuth work. First, I would try to perform a few simple operations while listening on the serial port. Setup your scope/logic analyzer to capture the bit pattern for some simple commands like an ID query. Watch what is sent along with the reply from the instrument. I did mention that typically the bits are 7-8; however, they could be almost any length. You might even be able to see any termination characters that were used as well.