Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,786,599 Members 38,348 Now Online
XDA Developers Android and Mobile Development Forum

[Hardware][Arduino][Pre-boot] Universal Arduino Serial Adapter

Tip us?
 
kemonine96
Old
(Last edited by kemonine96; 26th April 2013 at 12:55 AM.)
#1  
Recognized Developer - OP
Thanks Meter 1,218
Posts: 1,240
Join Date: Jan 2011
Location: Michigan

 
DONATE TO ME
Default [Hardware][Arduino][Pre-boot] Universal Arduino Serial Adapter

Overview
I have designed a "universal" serial adapter that the XDA community might appreciate. I recently needed access to a variety of devices using serial TTL and RS232 communication. The devices being a phone, router and firewall unit. I talked with a few friends that are in IT and polled some other ROM developers to get an idea on what they may find useful in a serial adapter device. Below is the result of the work. The idea is to have 1 serial adapter that takes care of all of your DB9 / null modem / goofy pinouts in one package.

Project Page
I have posted all of the code, pictures and an early circuit diagram to github: https://github.com/mcrosson/arduino_...serial_adapter . As I continue to develop and implement the project I will be pushing to github. Please note at this time the circuit diagram is a bit out of date. I am working on getting an updated diagram built but I am still learning Eagle and it will be a little while before I have it published.

Compatible Devices
  • Phone UART chips
  • Null modem serial ports
  • Cisco serial consoles

Working Features
  • Configurable line speed
  • TTL voltage adjustments (1.8V, 3.3V, 5V)
  • RS232 communication
  • Full UI

Future Features
  • Session recording to SD card
  • RTC for timestamped sessions and output timestamps
  • Inline display of serial communication on LCD Won't fix, LCD response is too low for this
  • RX/TX status via blinking the button LEDs

Known Issues
  • At 115200 line speeds the serial channel may drop characters -- This appears to be a speed limitation / bad code Fixed in dd981aa44d
  • UI timeout isn't reset when events occur Fixed in 7f60a42f9b
  • Timeout config doesn't reset / change current timeout Fixed in ebd4ac5d04

Code
IDE / Environment
This project was developed using stino (Sublime Text 2 plugin). It works slightly differently (read: more powerful) than the standard Arduino IDE. This project may or may not build under the Arduino IDE.

Configuration
The `Project.h` and `Project.cpp` files define the pinouts in use, Arduino pinout and a number of other items that may vary between builds. Please read through these [short] files and update the pinouts, addresses and anything else that may be different before uploading to your Arduino.

Prototype


Demo
I have posted some rough demo videos here (clickable) demonstrating some of the projects functions.

Parts
  • Arduino Mega
  • AdaFruit 1.8" LCD with MicroSD Card Slot
  • PSP Joystick
  • LED backlit buttons
  • Spark Fun MicroUSB breakout
  • AdaFruit logic level converter (bi-directional)
  • RJ-45 jacks
  • DB9 jack
  • Maxim Max3232 RS232 to TTL DIP IC's

Credits / Thanks
  • ChildOfTheHorn/Stacy Wylie
  • Adam Outler
  • Motorhead
  • utkanos
  • bhundven

Articles / Information Used For Project
Attached Thumbnails
Click image for larger version

Name:	DSCN2938.jpg
Views:	3263
Size:	105.8 KB
ID:	1891003  
The Following 11 Users Say Thank You to kemonine96 For This Useful Post: [ Click to Expand ]
 
Motorhead1991
Old
#2  
Motorhead1991's Avatar
Senior Member
Thanks Meter 197
Posts: 279
Join Date: Jul 2012

 
DONATE TO ME
Happy to be a part of it KemoNine. I'm all set with my simplified version but I'm still happy to have helped.
Google Plus Feed

Support my developments, buy my caffeine: Donate to Paypal > motor-head-1991@hotmail.com
 
sert00
Old
(Last edited by sert00; 21st April 2013 at 01:59 AM.)
#3  
sert00's Avatar
Senior Member
Thanks Meter 505
Posts: 1,082
Join Date: May 2011
Location: cesena,IT
second!
great works kemonine96,curious to try it!
My current mobile devices:
Samsung galaxy nexus maguro version 16Gb
Asus transformer WiFi-only 16Gb
Asus nexus 7 WiFi-only 16Gb
My current system embedded boards in use:
Arduino UNO (x2)
Arduino Mega 2560 (ADK support with USBHost Shield)
My current ARM boards:
Raspberry Pi rev.B
Hardkernel odroid-U2 with Exynos4412 PRIME x2 and all optional addons
Hardkernel odroid-XU-E with Exynos5410 x1 and all optional addons
 
kemonine96
Old
#4  
Recognized Developer - OP
Thanks Meter 1,218
Posts: 1,240
Join Date: Jan 2011
Location: Michigan

 
DONATE TO ME
Quote:
Originally Posted by sert00 View Post
second!
great works kemonine96,curious to try it!
Hopefully it works well for you. I've been hoping to find a solid solution to the problem of dropped serial data when running at faster line speeds. I'm thinking the code is setup in a way where it takes too long to process all of the input events. Going to be trying to set it up as an interrupt driven serial read/pass through to see if that fixes the problem any.

If not, I recently obtained an Arduino Due which should have enough CPU to keep up with everything compared to the standard Arduino Mega I'm currently using.
 
Nerve89
Old
#5  
Nerve89's Avatar
Junior Member
Thanks Meter 2
Posts: 6
Join Date: Jan 2011
Quote:
Originally Posted by kemonine96 View Post
Overview
I have designed a "universal" serial adapter that the XDA community might appreciate. I recently needed access to a variety of devices using serial TTL and RS232 communication. The devices being a phone, router and firewall unit. I talked with a few friends that are in IT and polled some other ROM developers to get an idea on what they may find useful in a serial adapter device. Below is the result of the work. The idea is to have 1 serial adapter that takes care of all of your DB9 / null modem / goofy pinouts in one package.

Project Page
I have posted all of the code, pictures and an early circuit diagram to github: https://github.com/mcrosson/arduino_...serial_adapter . As I continue to develop and implement the project I will be pushing to github. Please note at this time the circuit diagram is a bit out of date. I am working on getting an updated diagram built but I am still learning Eagle and it will be a little while before I have it published.

Compatible Devices
  • Phone UART chips
  • Null modem serial ports
  • Cisco serial consoles

Working Features
  • Configurable line speed
  • TTL voltage adjustments (1.8V, 3.3V, 5V)
  • RS232 communication
  • Full UI

Future Features
  • Session recording to SD card
  • RTC for timestamped sessions and output timestamps
  • Inline display of serial communication on LCD

Known Issues
  • At 115200 line speeds the serial channel may drop characters -- This appears to be a speed limitation / bad code
  • UI timeout isn't reset when events occur Fixed in 7f60a42f9b
  • Timeout config doesn't reset / change current timeout Fixed in ebd4ac5d04

Code
IDE / Environment
This project was developed using stino (Sublime Text 2 plugin). It works slightly differently (read: more powerful) than the standard Arduino IDE. This project may or may not build under the Arduino IDE.

Configuration
The `Project.h` and `Project.cpp` files define the pinouts in use, Arduino pinout and a number of other items that may vary between builds. Please read through these [short] files and update the pinouts, addresses and anything else that may be different before uploading to your Arduino.

Prototype


Demo
I have posted some rough demo videos here (clickable) demonstrating some of the projects functions.

Parts
  • Arduino Mega
  • AdaFruit 1.8" LCD with MicroSD Card Slot
  • PSP Joystick
  • LED backlit buttons
  • Spark Fun MicroUSB breakout
  • AdaFruit logic level converter (bi-directional)
  • RJ-45 jacks
  • DB9 jack
  • Maxim Max3232 RS232 to TTL DIP IC's

Credits / Thanks
  • ChildOfTheHorn/Stacy Wylie
  • Adam Outler
  • Motorhead
  • utkanos
  • bhundven

Articles / Information Used For Project
oh how i miss those breadboards
 
kemonine96
Old
#6  
Recognized Developer - OP
Thanks Meter 1,218
Posts: 1,240
Join Date: Jan 2011
Location: Michigan

 
DONATE TO ME
I managed to solve the dropped characters issue tonight. I am now using the Timer3 library (look for Timer1 library on non-mega hardware) to control the serial IO using an interrupt timer.

Works great with the interrupt driven IO. Next up is RTC and SD card integration.
The Following User Says Thank You to kemonine96 For This Useful Post: [ Click to Expand ]
 
kemonine96
Old
#7  
Recognized Developer - OP
Thanks Meter 1,218
Posts: 1,240
Join Date: Jan 2011
Location: Michigan

 
DONATE TO ME
Quick update on progress: I implemented some basic sd card logging and RTC functionality today. I also cleaned up some of the code and generally improved things.

Ran into an issue with sd card data transfers being "slow" which is forcing me to look into non-standard libraries for io purposes. My next step will be to be able to log data at 115200 baud to the sd card. Hopefully I'll have this rectified soon.
The Following 2 Users Say Thank You to kemonine96 For This Useful Post: [ Click to Expand ]
 
Maplobats
Old
#8  
Member
Thanks Meter 36
Posts: 61
Join Date: Oct 2012
Location: Shanghai
Quote:
Originally Posted by kemonine96 View Post
Quick update on progress: I implemented some basic sd card logging and RTC functionality today. I also cleaned up some of the code and generally improved things.

Ran into an issue with sd card data transfers being "slow" which is forcing me to look into non-standard libraries for io purposes. My next step will be to be able to log data at 115200 baud to the sd card. Hopefully I'll have this rectified soon.
Not a lot of activity in this thread lately, but I'm just getting into this area.
Have you made any progress on logging data to sd card?
Device: GT-i9300 32G
Kernel: Devil3.4_0.1.0
ROMs: First: ArchiDroid 1.7.11 (on f2fs!!!) Second: ArchiDroid 2.3.6
 
kemonine96
Old
#9  
Recognized Developer - OP
Thanks Meter 1,218
Posts: 1,240
Join Date: Jan 2011
Location: Michigan

 
DONATE TO ME
Quote:
Originally Posted by Maplobats View Post
Not a lot of activity in this thread lately, but I'm just getting into this area.
Have you made any progress on logging data to sd card?
No, I ran into some performance issues when I went to implement the feature. I believe I traced it down to some case statements but it's been awhile since I worked on the build.

Sent from my XT1053 using Tapatalk

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Try to Keep Up with Just Swipe Game

Sometimes, the simplest of games are the ones that end up beingthe most addictive and end up consuming … more

MultiROM Ported to the Moto E

Few categoriesof Android development are as intrinsically interestingas the ability to boot into multiple … more

XDA Xposed Tuesday: How to Control Google Play Wake Locks – XDA Developer TV

Xposed Modules are usually pretty simple. There are a few … more

Make Text Entry More Efficient with Macro Text Expansion

One of the best things about the modern day smartphone is its ability to save us … more