UART Transmission with atmega328p
-
- Posts: 103
- http://meble-kuchenne.info.pl
- Joined: Mon Dec 07, 2020 12:47 pm
- Been thanked: 1 time
-
- Valued Contributor
- Posts: 1628
- Joined: Wed Dec 09, 2020 9:37 pm
- Has thanked: 142 times
- Been thanked: 761 times
Re: UART Transmission with atmega328p
Odd - Can you print out the 30 bytes of data (of payload) - I'll have a play this evening (just on my phone at the moment).
It could be tat it is sending delta values but something else might be awry..
It could be tat it is sending delta values but something else might be awry..
Re: UART Transmission with atmega328p
0: 220
1: 197
2: 212
3: 213
4: 208
5: 87
6: 232
7: 195
8: 220
9: 213
10: 220
11: 85
12: 220
13: 197
14: 220
1: 197
2: 212
3: 213
4: 208
5: 87
6: 232
7: 195
8: 220
9: 213
10: 220
11: 85
12: 220
13: 197
14: 220
-
- Valued Contributor
- Posts: 1628
- Joined: Wed Dec 09, 2020 9:37 pm
- Has thanked: 142 times
- Been thanked: 761 times
Re: UART Transmission with atmega328p
Thanks,
First value is 220 + (197 * 256) =50652. This will display as a negative number on the LCD display (the print number takes signed 16 bit values)
Do the values look sensible or are they completely adrift (what is sending the data here?)
First value is 220 + (197 * 256) =50652. This will display as a negative number on the LCD display (the print number takes signed 16 bit values)
Do the values look sensible or are they completely adrift (what is sending the data here?)
Re: UART Transmission with atmega328p
The values should actually all be around 1500 (or at least the first 6, as the values come from a 6-channel RC transmitter). In the centre position, the value of each channel is 1500.
What is strange is that the strange received values vary by exactly 1000 between the upper and lower transmitter positions.
Just like the actual values can be between 1000 and 2000. The change is therefore transmitted correctly.
What is strange is that the strange received values vary by exactly 1000 between the upper and lower transmitter positions.
Just like the actual values can be between 1000 and 2000. The change is therefore transmitted correctly.
Re: UART Transmission with atmega328p
I have now saved the second received data records as standard values (the first data records after starting the program are strangely always different, from the second, they remain constant) I now always subtract these standard values from the received data and add 1500, i.e. I always get 1500 in the normal case. With a maximum change, the values are now between 1000 and 2000.
This solution is not a dream, but it works somehow...
This solution is not a dream, but it works somehow...
-
- Valued Contributor
- Posts: 1628
- Joined: Wed Dec 09, 2020 9:37 pm
- Has thanked: 142 times
- Been thanked: 761 times
Re: UART Transmission with atmega328p
Sounds like a good solution...
I wondered if it was a twos complement value - but that doesn't give reasonable values either?
So - glad it seems to be working AOK...
Martin
I wondered if it was a twos complement value - but that doesn't give reasonable values either?
So - glad it seems to be working AOK...
Martin
Re: UART Transmission with atmega328p
Here is your modified chart. What I don't like so much is this norm value and mean value formation, because you also have to ignore the first value.
I'm sure you have a better method for this, don't you?
Thanks again for your great help, I wouldn't have been able to do it otherwise!
Greetings Chris
I'm sure you have a better method for this, don't you?
Thanks again for your great help, I wouldn't have been able to do it otherwise!
Greetings Chris
- Attachments
-
- IBUS2.fcfx
- (23.37 KiB) Downloaded 99 times