element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      • Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Personal Blogs
  • Community Hub
  • More
Personal Blogs
Legacy Personal Blogs Getting started with Gertduino -  Are you serial?
  • Blog
  • Documents
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: doorknob
  • Date Created: 17 Apr 2014 12:49 AM Date Created
  • Views 1394 views
  • Likes 0 likes
  • Comments 12 comments
  • gertduino
  • all-sky
  • camera
Related
Recommended

Getting started with Gertduino -  Are you serial?

doorknob
doorknob
17 Apr 2014

Yes indeed, I'm super serial right now. Or is that supposed to be 'super cereal'?


I carefully followed the instructions for disabling login via the Pi's serial port. Then I disabled the Pi's boot messages (out to the serial port), shut down the system, set the jumpers to connect the Pi's serial transmit line to the Gertduino's serial receive line (and vice-versa), powered up the system (it booted up just fine, yay!), installed the minicom terminal emulator, installed the scrot screen capture utility, brought up the LXDE graphical environment, started minicom at 9600 bps over port /dev/ttyAMA0, started the arduino IDE, loaded, compiled, then uploaded the simple sample serial program Serial_startup.ino to the Gertduino, and this was the result: 

 

image

 

(I also tested keying into minicom and watching it echoed back, so both directions seem to be working.)

 

To set up the jumpers to let the Pi talk to the Gertduino, you need to hook them up in a criss-cross pattern. I used a hand wire-wrap tool and two short, pre-stripped lengths of #30 Kynar wire to make the connections. Here's a blurry photo (sorry) showing the jumpers:

 

image

 

I hereby declare phase 1 of my phased approach to getting the two boards talking a success. Phase 2 will involve a Python program talking to an Arduino program.

 

But before I go there, here's a really artistic photo showing the Gertduino's blue LEDs brightly lit up to celebrate the achievement:



image

  • Sign in to reply

Top Comments

  • doorknob
    doorknob over 11 years ago in reply to wegunterjr +1
    Are you using the Serial_startup.ino sample program on the Gertduino or are you using some other program? If you're not using Serial_startup.ino , then can you put together a barebones Arduino sketch using…
Parents
  • wegunterjr
    wegunterjr over 11 years ago

    I also have followed these steps:

    arefully followed the instructions for disabling login via the Pi's serial port. Then I disabled the Pi's boot messages (out to the serial port), shut down the system, set the jumpers to connect the Pi's serial transmit line to the Gertduino's serial receive line (and vice-versa), powered up the system (it booted up just fine, yay!), installed the minicom terminal emulator,


    I just can't remember if i did it manually, or if i used Gordon's script. Either way, it is complete.  I use minico to connect to the arduino (pi - 328 using the crossed wires) but all i get is gibberish in the window. Anything I Might be missing?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • doorknob
    doorknob over 11 years ago in reply to wegunterjr

    Receiving gibberish through serial communications often is a symptom of a bit rate mismatch between the sender and the receiver.

     

    I am away from my system at the moment, but IIRC both ends of the link were set for 9600 bps. Is that what you have set up?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • wegunterjr
    wegunterjr over 11 years ago in reply to doorknob

    alright, just followed the setup again, made sure the console was disabled in the /boot/cmdline.txt and in /etc/inittab

    The first and main one is /etc/inittab

    This file has the command to enable the login prompt and this needs to be disabled. Edit the file and move to the end of the file. You will see a line similar to

    T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100

    Disable it by adding a # character to the beginning. Save the file.

    #T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100


    Disable Bootup Info

    When the Raspberry Pi boots up, all the bootup information is sent to the serial port. Disabling this bootup information is optional and you may want to leave this enabled as it is sometimes useful to see what is happening at bootup. If you have a device connected (i.e. Arduino) at bootup, it will receive this information over the serial port, so it is up to you to decide whether this is a problem or not.

    You can disable it by editing the file /boot/cmdline.txt

    The contents of the file look like this

    dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait

    Remove all references to ttyAMA0 (which is the name of the serial port). The file will now look like this

    dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait

     

    I checked my serial port baud

    sudo stty -F /dev/ttyAMA0           9600 was listed


    My arduino project (the serial start up from gertduino was set to 9600 also)


    when i run minicom, i get a square with 1 0 0 1  and Q.  It looks like it is coming out in a pattern, but ....not sure what else to do.


    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • doorknob
    doorknob over 11 years ago in reply to wegunterjr

    Are you using the Serial_startup.ino sample program on the Gertduino or are you using some other program? If you're not using Serial_startup.ino, then can you put together a barebones Arduino sketch using Serial.begin(9600) and Serial.println("some test characters") to see if you can either see the characters correctly on the Pi, or else figure out how whatever is displayed on the Pi is related to the characters that your sketch is sending?

     

    The fact that you are seeing characters in the minicom window likely means that it is evidently receiving characters (even if gibberish) from the Gertduino. You can probably verify that by temporarily disconnecting the jumper from the Gertduino's TX line to the Pi's RX pin - the characters should no longer appear (it might be prudent to temporarily connect the Pi's RX pin to GND rather than leaving it 'floating').

     

    If the characters stop showing up on minicom after doing that, then I can think of several possible troubleshooting steps to take from that point. You have two sides of a communication line - one is the Pi and the other is the Gertduino - so you can try to check each side independently of the other (although that may require some additional parts and pieces). For example, do you have any other device available (maybe a generic Arduino) that can send known serial communication over a TTL-level port (but use a resistive voltage divider to cut down the 5 volts to 3.3 volts max for the Pi's input), that you could connect to the Pi's input in place of the ATmega328's output? Or, do you have an RS-232 level serial communication source that you can send to the Pi's input through the Gertduino's level converter (with appropriate use of the jumpers)?

     

    Similarly, do you have a generic Arduino that you could patch into the serial TX output from the Gertduino (isolated from the Pi), using a simple character echo sketch with the Arduino's softwareSerial() interface to some pin other than the normal RX pin used by the Arduino's FTDI USB converter, to try and read the transmitted characters from the Gertduino on the other Arduino?

     

    It may be tedious to do those tests, but they should help you to narrow down your focus to one side of the communication link or the other as the culprit.

     

    ==> One other thought comes to mind - are you sure that you are running the Gertduino with a 16 MHz clock instead of an 8- or 1-MHz clock? I haven't checked to see if the serial bit rate depends on the ATmega328P's clock, but it's certainly possible.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • doorknob
    doorknob over 11 years ago in reply to doorknob

    Further thoughts on that last thought - do you have access to an oscilloscope?

     

    If so, it might be easiest to confirm that the Gertduino is transmitting at 9600 bps by probing the Gertduino's TX line while it is transmitting, and measuring the shortest bit duration that you see, then compare that to what should be expected for 9600 bps - I haven't done the math, and I'm about to run out for a meeting, but I've done that before to figure out or verify a serial bit rate.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • wegunterjr
    wegunterjr over 11 years ago in reply to doorknob

    How do i change that?  I will look into that. I haven't made any of those changes intentionally.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • wegunterjr
    wegunterjr over 11 years ago in reply to wegunterjr

    Thanks for all the help so far.  So, I understood most of what you said, but I was able to use an additional arduino to check if the gertduino was sending out good values using the software serial sketch.  here is what I did:

     

    1.  Gertduino TX - Pin 10 (RX) on the 2nd arduino

    2. Gertduino RX - Pin 11 (TX) on the 2nd arduino

    3. changed all baud rates to 9600

    a. gertduino Serial.begin(9600)

    b. 2nd arduino Serial.begin(9600);    in the setup loop at the top

    c. 2nd arduino mySerial.begin(9600)    //this is the software serial, and in the setup loop also

     

    when i use serial monitor for the 2nd arduino, i see Goodnight MOon (text at the top of the setup loop), but I don't see the  mySerial.println("Hello, world?");

     

    then it is all gibberish again.

     

    Walter

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
Comment
  • wegunterjr
    wegunterjr over 11 years ago in reply to wegunterjr

    Thanks for all the help so far.  So, I understood most of what you said, but I was able to use an additional arduino to check if the gertduino was sending out good values using the software serial sketch.  here is what I did:

     

    1.  Gertduino TX - Pin 10 (RX) on the 2nd arduino

    2. Gertduino RX - Pin 11 (TX) on the 2nd arduino

    3. changed all baud rates to 9600

    a. gertduino Serial.begin(9600)

    b. 2nd arduino Serial.begin(9600);    in the setup loop at the top

    c. 2nd arduino mySerial.begin(9600)    //this is the software serial, and in the setup loop also

     

    when i use serial monitor for the 2nd arduino, i see Goodnight MOon (text at the top of the setup loop), but I don't see the  mySerial.println("Hello, world?");

     

    then it is all gibberish again.

     

    Walter

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
Children
No Data
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube