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
      •  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
  • Settings
RoadTests & Reviews
  • Products
  • More
RoadTests & Reviews
RoadTest Forum mbed road test - first impressions/what next?
  • Blogs
  • RoadTest Forum
  • Documents
  • RoadTests
  • Reviews
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join RoadTests & Reviews to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Suggested Answer
  • Replies 13 replies
  • Answers 2 answers
  • Subscribers 2568 subscribers
  • Views 1445 views
  • Users 0 members are here
  • RoadTest
  • mbed
Related

mbed road test - first impressions/what next?

romilly
romilly over 15 years ago

I was lucky enough to be selected for an mbed road test, and the mbed package arrived yesterday.

 

I'd read Riccardo Tinivella's excellent mbed review. Like him I found the product very easy to get going. The website suggests that you can get started in 60 seconds, and that's exactly how long it took me.

 

I use two PCs - a laptop running Windows 7 64-bit on an AMD processor, and a Linux workstation. Both systems drive the mbed happily. The combination of web-based development and filesystem-based programming is a stroke of genius. It completely bypasses the USB driver problems I've hit with other development products on my Windows machine.

 

The first project I had in mind for the mbed was a poor man's oscilloscope/logic analyser to help me debug the I2C boards I am working on at the moment. I needed something which would let me visualise the digital signals on the I2C bus, and if possible plot some analogue data as well.

 

It turned out to be really easy to implement. There's a lot of sample code on the mbed website. It's well organised, and it's easy to search. After a few minutes I was able to write formatted data to the mbed file system, including  digital and analogue inputs. I wrote the data out in csv format, and then displayed the results on my PC.

 

This is a (very simple) example of the sort of prototyping for which the mbed was created. I'm seriously impressed by mbed's ease of use and range of available libraries. I expect to use the mbed a lot for future projects.

 

For my main review, I'm proposing to port some code I wrote for the arduino using the I2c bus. It's a homebrew version of the microwriter keyboard, and drives an LCD display and an EPROM memory. From what I've seen so far, it looks as if the porting will be very straightforward.

 

Riccardo has already covered many of the questions people might have about the mbed. Is there anything you would like me to investigate for my review?

  • Sign in to reply
  • Cancel
Parents
  • romilly
    0 romilly over 15 years ago

    I'm getting more familiar with the mbed and its libraries by taking baby steps. I'll post whenever I have something to report, and summarise my results in a detailed review later.

     

    The mbed site has several useful sections. The handbook documents the core libraries; the cookbook documents contributed code which the authors feel is ready for sharing.

     

    Each user can also create notebooks in which to record work in progress. You can make a notebook visible if you want, but you don't have to.

     

    Yesterday I made a start by hooking up a Text LCD to the mbed and using some cookbook code to drive it. I modified the sample code slightly to use different mbed pins.

     

    Here's all you need to drive the LCD:

     

    #include "mbed.h"
    #include "TextLCD.h"

     

    TextLCD lcd(p10, p12, p15, p16, p17, p18); // rs, e, d0-d3

     

    int main() {
        lcd.printf("Hello World!\n");
        lcd.printf("What fun!");
    }

     

    I'm currently working on a different driver which will use I2C and a PCF8574 port expander to drive the LCD.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Reply
  • romilly
    0 romilly over 15 years ago

    I'm getting more familiar with the mbed and its libraries by taking baby steps. I'll post whenever I have something to report, and summarise my results in a detailed review later.

     

    The mbed site has several useful sections. The handbook documents the core libraries; the cookbook documents contributed code which the authors feel is ready for sharing.

     

    Each user can also create notebooks in which to record work in progress. You can make a notebook visible if you want, but you don't have to.

     

    Yesterday I made a start by hooking up a Text LCD to the mbed and using some cookbook code to drive it. I modified the sample code slightly to use different mbed pins.

     

    Here's all you need to drive the LCD:

     

    #include "mbed.h"
    #include "TextLCD.h"

     

    TextLCD lcd(p10, p12, p15, p16, p17, p18); // rs, e, d0-d3

     

    int main() {
        lcd.printf("Hello World!\n");
        lcd.printf("What fun!");
    }

     

    I'm currently working on a different driver which will use I2C and a PCF8574 port expander to drive the LCD.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Children
  • romilly
    0 romilly over 15 years ago in reply to romilly

    My mbed road test activity for today has been the development of some I2C code. The mbed I2C library is really easy to use.

     

    It's gone well. I started by getting a simple program to drive a PCF8574 port expander. You can see it running on the right.image

     

    My next program was an I2C-based LCD driver. It's working, but I need to clean up the code before I publish it. I hit a couple of minor problems on the way. Both issues are covered in the documentation, but they are easy to forget if you are coming from an arduino background.

     

    The first is that the mbed I2C interface now uses 8-bit addressing, since that's what is used by most I2C component datasheets. The arduino Wire library uses 7-bit addressing. If you're talking to a PCF8574 port expander, you would address it at 0x20 in an arduino script but as 0x40 in an mbed program.

     

    This is clearly stated on the I2C page of the mbed on-line handbook, but the PCF8574 example in the cookbook used the 7-bit address; as a result the code example did not work. I've now fixed the cookbook page.

     

    The second problem is also covered in the handbook. You must have pull-up resistors on the SDA and SCL lines of an I2C design. That's mandated by the standard, but many of us arduino developers have got out of the habit; the adruino I2C library turns on internal pull-ups, so you don't need external ones. With the mbed you do.

     

    While debugging my code I discovered one very useful tool - Simon Ford's I2CU bus walker. This neat utility tries to read from each possible I2C device address and reports on each one it finds. If you forget the pull-up resitors, it won't find anything. Once you've added them, it will help you to find the correct 8-bit addresses for your I2C slaves.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 15 years ago in reply to romilly

    Great review so far, Romily.

     

    Keep up the good work!

     

     

    Elias

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • romilly
    0 romilly over 15 years ago in reply to Former Member

    Thanks, Elias. I'm glad you found the review interesting.

     

    I've now published the LCD I2C code on the mbed website.

     

    Next I'll be experimenting with the mbed Serial libraries.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • 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 © 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