- Joined
- Mar 26, 2018
- Messages
- 2,719
Well the whole Arduino thing was a bust. I set up a basic program with manchester decoding and tried to get the serial port talking at all the standard baud rates. The max baud rate supported by the manchester library was 57600 baud. I never caught a single serial packet.
Working on an oscilloscope makes it pretty easy to get zoomed in and forget how fast these signals are coming in. In this case, the serial data is 2Mbps or 1M baud. There is no way a microprocessor with a 16MHz clock can keep track of a 2MHz signal, let alone do anything with it, write to memory, read other serial channels, etc.
I have a STM32 Nucleo development board that clocks in at 200MHz. Definitely a higher performance chip. I might mess around with this and see if I can decode the signals, but I'm shopping for a new microprocessor that can do the job. I've boiled the tasks it need to perform down to the following:
I have someone at work who can loan me a motor with the encoder I am trying to emulate. That way I can scope all the communications with the drive and fully document what I need to develop. I'm going to hold off on that for a little while.
-Mike
Working on an oscilloscope makes it pretty easy to get zoomed in and forget how fast these signals are coming in. In this case, the serial data is 2Mbps or 1M baud. There is no way a microprocessor with a 16MHz clock can keep track of a 2MHz signal, let alone do anything with it, write to memory, read other serial channels, etc.
I have a STM32 Nucleo development board that clocks in at 200MHz. Definitely a higher performance chip. I might mess around with this and see if I can decode the signals, but I'm shopping for a new microprocessor that can do the job. I've boiled the tasks it need to perform down to the following:
- Read quadrature encoder @ 680kHz, update position in memory. Interrupt based?
- Read serial channel (2Mbps, 1M baud, manchester encoding), verify CRC, parse data, save to memory. 24kHz packet refresh rate.
- Compare quadrature encoder position and serial data, cross check for errors.
- Read serial channel (2.5Mbps, NRZ encoding), verify CRC, parse data. Unknown packet rate. Assume 24kHz.
- Write serial channel (2.5 Mbps, NRZ encoding) using data from memory. Perform basic math on data (bit shift, fill zeros, etc.), calculate CRC, generate packet format with proper start and stop sequences. Refresh rate matches request frequency of the previous read operation.
I have someone at work who can loan me a motor with the encoder I am trying to emulate. That way I can scope all the communications with the drive and fully document what I need to develop. I'm going to hold off on that for a little while.
-Mike