element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Members
    Members
    • Benefits of Membership
    • Achievement Levels
    • Members Area
    • Personal Blogs
    • Feedback and Support
    • What's New on element14
  • Learn
    Learn
    • Learning Center
    • eBooks
    • 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
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Dev Tools
    • Manufacturers
    • Raspberry Pi
    • RoadTests & Reviews
    • Avnet Boards Community
    • Product Groups
  • 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
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • 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
Personal Blogs
  • Members
  • More
Personal Blogs
Legacy Personal Blogs Getting started with Gertduino -  Are you serial?
  • Blog
  • Documents
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Blog Post Actions
  • Subscribe by email
  • More
  • Cancel
  • Share
  • Subscribe by email
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: doorknob
  • Date Created: 17 Apr 2014 12:49 AM Date Created
  • Views 448 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 9 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…
  • doorknob
    doorknob over 9 years ago in reply to wegunterjr

    One other possibility that comes to mind - there is no "flow control", either hardware or software, between the Gertduino and the Pi over the serial port - so could it possibly be that there is a buffer overflow on the receiving side? I'm not sure that such a condition would result in gibberish appearing though (rather, you might get gibberish with a "framing error", but it's hard to see how that would be occurring here).

     

    One way to test that assumption (that buffer overrun is occurring) might be to send only short messages from the Gertduino to the Pi, and to put a time delay (half a second?) between messages, to see if that changes anything. But again, I'm not sure that that would lead to gibberish.

     

    Back to when you were using Arduino #2 to talk to the Gertduino, were you testing having the Gertduino transmit and Arduino #2 only receive (and forward what's received to the serial monitor)? When you talked about mySerial.println("Hello, world?") it sounded like Arduino #2 was talking to the Gertduino instead of the other way around.

     

    Speaking of flow control and buffer overruns, softwareSerial on the Arduino supposedly eats up a lot of the ATmega328's horsepower. I hope that you aren't seeing an artifact of running out of steam when receiving characters via softwareSerial and passing them along to the serial monitor via the regular serial UART. If that is an issue, then perhaps using short messages with long delays in between might help (I'm assuming that the Arduino delay() call uses one of the AVR timer registers instead of just spinning on a no-op, but I haven't investigated it or thought through all of the implications, and I'm not even sure whether softwareSerial  may even have a conflict with a delay() call - too many things to look up, sorry).Maybe rather than using a delay, you can use a button-press to trigger a short communication, and the delay can be had by simply waiting a second between button presses - just thinking out loud here - but I'd rather not introduce spurious bugs into the setup that you're trying to use to diagnose other bugs. Hope that's clear - it's been a long day for me....

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

    It seems that the settings were for gertboards, and that is what I got when I ran the script provided from Gordon https://projects.drogon.net/raspberry-pi/gertduino/

    Maybe we need to add a board option in the boards.txt file to account for that...or maybe I have the older script. 

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

    Also, the timing that is in the boards.txt file l have is 12Mhz and not 16, so I had to change this:

     

    /usr/share/arduino/hardware/arduino/boards.txt

     

    gert328.build.f_cpu=12000000L

     

    to

    gert328.build.f_cpu=16000000L



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

    I found this

     

    avrdude -qq -c gpio -p atmega328p -U lock:w:0x3F:m -U efuse:w:0x07:m -U lfuse:w:0xE7:m -U hfuse:w:0xD9:m

    from GertDuino Getting Started Tutorial – Hello World | Raspberry Pi Spy....    I did a reset on the gertduino, even recycled the PI to cut power, and made sure all the baud rates were 9600 on both sides.  Still getting gibberish.  ( I am happy there is a connect, but would like something clean to come through)

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • wegunterjr
    wegunterjr over 9 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
>
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 © 2023 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

  • Facebook
  • Twitter
  • linkedin
  • YouTube