If you're a fan of electronics then you like me will often find it annoying on the lack of hardware serial ports on modern devices. Many modules like the Wifi ESP8266 and the Bluetooth HC-06 are available for peanuts but they each require a UART based serial peripheral on your controller to work effectively. In fact a huge range of external electronics can be added to your system via a serial UART connection: GPS, GSM (mobile phone), RFID, RS232, LIN, Ethernet, Zigbee, Modbus, DMX, 4D systems graphical LCDs to name a few more.
Most modern microcontrollers and devices like the Raspberry Pi have at least one serial UART peripheral so you can do a lot with these devices. However now and then you need to combine several communications style modules together into a single design. A recent project I undertook was a mobile alarm system which used Bluetooth proximity to arm / disarm the system, GPS to track the location, Accelerometer to track movement and GSM based SMS messages to inform the owner where their item is.
The Arduino Mega 2560 offers four serial UART peripherals but what if that is not enough or you need something more affordable for mass production. To move to a different chip may mean rewriting your entire code so is there an easier way?
These modern microcontrollers commonly also feature a peripheral named SPI which is typically a lot faster then a UART based serial peripheral and can be used to talk to multiple devices by use of individual chip select signals from the controller. If the controller does not have an SPI peripheral then it can simply be driven using a bit banged software approach using standard I/O pins with no major downfalls. By using the SPI interface and my design you can communicate with up to four serial UART peripherals simultaneously.
Here is my open source project to create a SPI to 4 UART bridge code name MULTIUART or SPI2UART.
http://www.instructables.com/id/SPI-to- ... MULTIUART/
I have now created a Flowcode component to drive the hardware which is compatible with Flowcode 6 and 7.
Install the component by copying the file below into your "Flowcode 6/Components" or "Flowcode 7/Components" directory.
In the interests of keeping things open source here is the Flowcode source code used to create the component.
Here is a test program I created to test the MULTIUART boards using an ECIO28P and transmitting data back to the PC using the USB serial component.
If you're interested then a small number of boards are currently available on sale on eBay.
This is a personal project by Ben Rowland and not in any way associated with Matrix TSL products.
A forum where Flowcode v6 user created components can be shared, discussed and reviewed.
1 post • Page 1 of 1
- Matrix Staff
- Posts: 14557
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4590 times
- Been thanked: 4235 times
- Rating: 21.05%