New answers tagged

1

I've actually done something quite similar. On a hardware level, you can do it with most recent microcontroller like PIC32, STM32 that contains 2 USB port that can be in host mode. On the firmware level, it will be a bit tricky because you will need to code some logic for the data transfer and if I understand, you want to connect two host device together, ...


0

From one of your previous questions I gave you some links, where this is implemented. Source code USART3_IRQHandler(void) { /* Check for IDLE line interrupt */ if (LL_USART_IsEnabledIT_IDLE(USART3) && LL_USART_IsActiveFlag_IDLE(USART3)) { LL_USART_ClearFlag_IDLE(USART3); /* Clear IDLE line flag */ usart_rx_check(); ...


1

That IRQ is dedicated for USART2, but it gets called for every enabled interrupt associated with USART2. That means that the handler needs to check and handle every enabled interrupt signal. For STM32 USART, that includes signals fundamental to interrupt driven UART like TXNE and RXNE, as well as error signals, IDLE, etc. The IDLE signal is for framing multi-...


2

That interrupt is used for both transmit and receive. The IDLE is relevant only to reception, it means there is at least one full frame of idle detected. Using print in an interrupt is unwise, espcially if the print uses the same UART for which the interrupt is.


0

The modern equivalent would be an MCU programmed to act similarly to a 6402, or perhaps a CPLD such as the Microchip ATF1508. But why would you design a 'modern' device to use such an ancient inflexible IC? Your application would probably be better suited to an MCU which could perform many other tasks than just converting parallel <-> serial with ...


0

Almost none of the USB to RS-232 adapters will use 12V. They typically use charge pumps to boost 5V or 3.3V to acceptable RS-232 levels, i.e. the output just has to exceed 5V when connected into standard RS-232 load, But you don't know if the device really needs 12V on that pin. It might be an RS-232 input after all, and the manual might simply mean to ...


3

hdma_usart2_tx.Init.PeriphDataAlignment = DMA_PDATAALIGN_HALFWORD; hdma_usart2_tx.Init.MemDataAlignment = DMA_MDATAALIGN_HALFWORD; These two should be se to byte alignment. It's set to halfword, so it does DMA on 2 bytes, but the UART registers only has 1 byte, so half the bytes fall into a black hole: uint8_t rs485TxBuffer[17]={0x02,0x0A,0x00,0x01,0x00,...


1

You may not re-transmit until the previous message isn't completely sent. dmaTransmitCompletedFlag = 1; while(1U) { // Communication Test Block // if dmaTransmitCompletedFlag { dmaTransmitCompletedFlag = 0; HAL_UART_Transmit_DMA(&huart2, (uint8_t *)rs485TxBuffer, 17); } } .. void UART_DMATransmitCplt(&huart2)...


0

This is a shopping question and these are generally frowned upon, but I’m inclined to think that it’s general enough to be of use to the wider community. I’d have a high degree of confidence that anything claiming to be RS232 and terminating in a DE-9 connector is 12V compatible. Devices that terminate in 0.1” pin headers are typically 3V. The interface ...


2

If both devices respond at approximately the same time then you’ll have a collision and can expect data errors. For RS485 you should make sure that only one device is transmitting at a time, so either poll the devices individually or add delays so that each device responds in its own ‘time slot’. At 9600 baud the data rate is about 1000 bytes per second, ...


3

The only reason for a framing error is when an UART frame is received with an invalid stop bit. The invalid stop bit may be invalid due to noise or too large difference in the baud rates.


1

Try removing C28 and C29. I could only get mine working properly without those values.


3

It makes sense to distinguish between transmission and reception of data as they are quite different in this context. Transmission is straightforward. If several bytes are ready to be transmitted, DMA can be configured for this specific length and the transmission can be started. It is usually helpful to add a buffer. So if the code wants to transmit ...


0

The buffer size is constant, can't be variable, you define it in the declaration. The received or transmitted data length is not constant, meaning the buffer is several times larger than largest data packet. Depends on your architecture, maybe you can trigger an interrupt if new data don't arrive within few clock cycles. Assuming the transmitting device ...


3

... average UART signal Um, I don't think you mean what that means, instead you mean: ... average the GPS position and output a UART GPS signal which means you need a microcontroller to interact with your two GPS receivers, do the averaging, and send out a new NMEA message "downstream". Note, however, that this is not a good idea, usually. If ...


1

From the video at around 2:00 "... The UART itself I think it's worth mentioning is actually just built into the micro USB connection on the Go board ..." You could just use your own USB-UART module, like one of these: https://www.amazon.com/FTDI-serial-cable-TTL-232R-3V3-WE-compatible/dp/B073VMXRVL "FTDI chip USB to 3.3v TTL UART Serial ...


0

Not 100% confident in this answer, but I think there is a lot of info that will help you so I'm putting it here for the better formatting. What to do First off, if your microcontroller does not have a valid program (meaning anything with the proper checksum) in application space, the board should enter bootloader mode automatically. If you programmed the ...


0

After Chengxian Zhangs comment I have increased the 10pF capcitors to 20pF. And the problem was solved. It seems that it was a far simpler problem than I originally anticipated.


1

You're probably not waiting until all the transmit bytes have been sent before changing the rs485 bus direction. Under Linux using a usb->rs485 converter takes care of this in hardware. When using the on chip serial ports, you'll probably need to read up on the serial driver and use the RTS to control the bus direction. Failing that, add a delay of a few ...


0

FTDI chips baudrates are based on a 3Mhz reference clock which is then divided down: reg divider baudrate 10,27 10000 300 88,13 5000 600 C4,09 2500 1,200 E2,04 1250 2,400 71,02 625 4,800 38,41 312.5 9,600 D0,80 208.25 14,406 9C,80 156.25 19,200 4E,C0 78.125 38,400 34,00 52 57,692 1A,00 26 115,384 0D,00 13 230,769 06,40 6.5 461,538 03,80 3.25 ...


Top 50 recent answers are included