Sony Updates AOSP Sources to Android 5.0.1

Just a few days ago, Sony did an utterly fantastic job by pushing out numerous device trees for … more

Stop Your Screen From Turning Off with KeepItOn

We all know the feeling of reading a news article orrather longdocument, when our screen … more

The XDA LG QPair Developer Challenge Voting Has Begun!

It seems like it was just yesterday that weannounced that we had paired up with LGto … more

Major Update for the Sony Smartwatch 2 Brings DND and More

With the wearables landscape now dominated by Android Wear and Pebble, its … more

Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

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

OP kemonine96

17th April 2013, 08:19 PM   |  #1  
OP Recognized Developer
Flag Michigan
Thanks Meter: 1,235
 
1,258 posts
Join Date:Joined: Jan 2011
Donate to Me
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:	3425
Size:	105.8 KB
ID:	1891003  
Last edited by kemonine96; 26th April 2013 at 01:55 AM.
The Following 11 Users Say Thank You to kemonine96 For This Useful Post: [ View ]
17th April 2013, 11:51 PM   |  #2  
Motorhead1991's Avatar
Senior Member
Thanks Meter: 208
 
289 posts
Join Date:Joined: Jul 2012
Donate to Me
More
Happy to be a part of it KemoNine. I'm all set with my simplified version but I'm still happy to have helped.
21st April 2013, 02:53 AM   |  #3  
sert00's Avatar
Senior Member
Flag cesena,IT
Thanks Meter: 505
 
1,082 posts
Join Date:Joined: May 2011
More
second!
great works kemonine96,curious to try it!
Last edited by sert00; 21st April 2013 at 02:59 AM.
21st April 2013, 05:54 AM   |  #4  
OP Recognized Developer
Flag Michigan
Thanks Meter: 1,235
 
1,258 posts
Join Date:Joined: Jan 2011
Donate to Me
Quote:
Originally Posted by sert00

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.
22nd April 2013, 04:34 PM   |  #5  
Nerve89's Avatar
Junior Member
Thanks Meter: 2
 
6 posts
Join Date:Joined: Jan 2011
Talking
Quote:
Originally Posted by kemonine96

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
25th April 2013, 05:00 AM   |  #6  
OP Recognized Developer
Flag Michigan
Thanks Meter: 1,235
 
1,258 posts
Join Date:Joined: Jan 2011
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: [ View ]
26th April 2013, 04:18 AM   |  #7  
OP Recognized Developer
Flag Michigan
Thanks Meter: 1,235
 
1,258 posts
Join Date:Joined: Jan 2011
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: [ View ]
26th February 2014, 08:15 AM   |  #8  
Member
Shanghai
Thanks Meter: 36
 
61 posts
Join Date:Joined: Oct 2012
Quote:
Originally Posted by kemonine96

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?
26th February 2014, 02:50 PM   |  #9  
OP Recognized Developer
Flag Michigan
Thanks Meter: 1,235
 
1,258 posts
Join Date:Joined: Jan 2011
Donate to Me
Quote:
Originally Posted by Maplobats

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

Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes