Capturing and storing a data stream.

Hi Guys,

I am about to embark on another little project. Another motorcycle one. I am after a bit of advice and guidance.........yes everybody already tells me where to go.

I will probably be using an ATTiny3217.

I don't know the format yet or the finer details but here is what I want to do in simple terms.

I want to receive a data string which I believe is 10 messages of 8 bytes each. 8N1 I think.

I want to capture/store it, replace/modify a byte and then transmit it out a different line.

The fun bit in my mind is that the next packet/stream will probably start arriving before the previous one has had time to be transmitted.

Is it possible to store this in RAM, modify it and transmit is while the next packet is being received and stored in RAM.

If its coming in the serial port, then its already saving off 64 bytes for you.

-jim lee

efficient microcontroller-programming starts with analysing the requierements which are fixed.

jimLee:
If its coming in the serial port, then its already saving off 64 bytes for you.

-jim lee

Not necessarily the serial port.

StefanL38:
efficient microcontroller-programming starts with analysing the requierements which are fixed.

At this stage I don't care about efficient programming. I just want to know if it can be done and the best way to approach it.

A bit more info.

10 messages/second @ 100ms apart
each message is 8 bytes @ 5ms apart. Start to start.

last byte is Checksum

7800 baud. This will probably require SoftwareSerial.

This data is from a motorcycle ECU to the dash cluster.

There is one byte I want to change (I don't know which one yet).

EDIT: Clarified some measurments.

Bumpity

windoze_killa:
Is it possible to store this in RAM, modify it and transmit is while the next packet is being received and stored in RAM.

Generally, yes it is possible. A specific answer is not possible without specific information. Thus only you can decide the best way to approach it.

Do you know/can you find out the delimiter per message?

This is the message

This is the message

Is the first byte always the same? If so then you look for the start byte and read 7 more bytes.

each message is 8 bytes @ 5ms apart. Start to start.
7800 baud.

How did you get the figure of 7800 for baud rate?

If there is indeed 1 start bit and 8 data bits then there are way more than one stop bits to get to 5 ms per byte with 7800 bits/second.

7800 baud. This will probably require SoftwareSerial.

I don't see how software serial will help with an unsupported baud rate.

More likely you will have to bit bang the entire protocol.

Hi,

The first byte is not always the same unfortunately.

7800 Baud is from a bit being 1 second divided by the bit width of 0.128ms.

there are 9 bits that I can make out.

The 5 ms is from the start of one byte to the startof the next. ~3.96ms gap between bytes.

With the chips I am hoping to use the USART is fully programable to ANY baud rate (so I have been told). Being full duplex with independent TX and RX.