简体   繁体   中英

How can I receive multiple messages on UART?

I have an RDM6300 RFID writer/reader. It can read RFID Tags and it sends the data via UART to a microcontroller. So far I worked with multiple Microcontrollers from which ones the STM32F04 had the most UART "ports" (8 transmitters and receivers). The Arduino has got a few, but it is not enough.

I want to have 25 RFID readers (that are reading almost at the same time), but I can't find a way to send data from all the readers to one microcontroller.

Is there a way how can I connect 25 readers to ONE microcontroller?

You have 25 things transmitting at 9600 bps. You have an MCU running at 180 MHz with 8 UARTS and lots of timer capture channels (32 channels, 30 of them usable on the 100 pin STM32F427VITx ). 8 of the 25 inputs are taken care of by the UARTS, 17 needs to be processed by other means. Connect them to timer capture channels.

The MCU runs at 180 MHz, the inputs change state at 9600 Hz, that means 18750 clock cycles between events. Should be way more than enough to process all of them, if you don't use HAL.

  1. read the timer status register, check for capture events and clear them
  2. check pin state, low means start of a frame
  3. store the capture register value for that channel
  4. keep checking for capture events
  5. if there is one, clear it
  6. read the capture timestamp, subtract the stored value from step 3 from it
  7. calculate the number of bits received with identical state
  8. keep doing it until you have 9 bits (start bit + 8 data bits) and high input on the pin

Do the above in parallel for all 17 channels. You need a suitable prescaler for the timers so they won't overflow while reading a full frame (9*18750=168750 cycles)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM