10
votes
Accepted
Transmitting from PC via USART to MCU working but very slow
an AVR ATmega MCU sitting on a breadboard, running at 8 MHz with the internal oscillator.
This is likely to be your problem. This Atmel application note (source) suggests that an uncalibrated ...
6
votes
Transmitting from PC via USART to MCU working but very slow
So you are using the internal oscillator.
This is most likely the issue.
You don't say which AVR you are using, but generally, internal oscillators on AVRs are not accurate enough for UART.
At least ...
4
votes
STM32 communication
Transmitting sizeof(txbuf) number of bytes is almost certainly a bug. The "nan" etc garbage likely comes from sending uninitialized parts of the buffer ...
3
votes
Accepted
FTDI FT234XD not recognized
The diodes are completely unsuitable for high speed data lines such as 12Mbps USB. They are also unidirectional so they don't protect from negative ESD.
The diodes seem to have capacitance beyond ...
3
votes
Is it okay to call a UART “RS-232” if it doesn’t respect voltage levels specified in the RS-232 standard?
You are correct, those 0/5 V levels are not 'RS232' physical layer, which uses up to +/- 15 V. Many people say RS232, when they mean UART, the protocol, regardless of which physical layer is used to ...
2
votes
STM32 communication
The nan output you see means "Not a Number" and can occur for a wide number of reasons when floating point numbers "go wrong". (...
2
votes
Is it okay to call a UART “RS-232” if it doesn’t respect voltage levels specified in the RS-232 standard?
No, it is not OK to call an UART as RS-232, because they are two completely different things, located at different layer on OSI model for networking. RS-232 would be the physical layer, and UART would ...
2
votes
STM32 - HAL_UART_Receive first byte is always zero
As brhans mentioned, the problem was that after reset, an empty 0x00 byte came into the buffer and caused every next frame to be shifted by 1 byte - the first byte was the last byte from the previous ...
1
vote
STM32 communication
Your code starts data reception via interrupts, but immediately after starting the reception, even without receiving any data, you are trying to convert nothing that has been received into three ...
1
vote
Internal RC oscillator for reliable UART
By itself, the MCU internal oscillator has 2% tolerance over large operating temperature and voltage range.
And, under ideal conditions, the bit sampling can be half a bit off at the stop bit. In ...
1
vote
Digital signal routing for EMI/EMC
The 'best way' to do anything for EMC is very nuanced, and the answer will always be some form of "it depends". It's incredibly dependent on routing, and other board-specific constraints, ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
uart × 1593serial × 284
stm32 × 276
microcontroller × 260
pic × 174
usb × 135
c × 115
avr × 105
arduino × 99
rs232 × 92
interrupts × 81
atmega × 78
embedded × 68
communication × 68
rs485 × 62
ftdi × 59
spi × 52
i2c × 44
baudrate × 41
bluetooth × 40
microchip × 39
ttl × 37
fpga × 34
dma × 34
msp430 × 33