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
    About the element14 Community
  • 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 Things Learnt from Digital I/O...
  • Blog
  • Documents
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: WestfW
  • Date Created: 31 Aug 2010 4:27 AM Date Created
  • Views 538 views
  • Likes 0 likes
  • Comments 0 comments
  • avr
  • msp430
  • arduino
  • launchpad
Related
Recommended

Things Learnt from Digital I/O...

WestfW
WestfW
31 Aug 2010

I think I mentioned at the beginning of this series that I expected that porting the Arduino environment to MSP430 would be educational as well as potentially useful.  So, have we learned anything interesting so far?  I think so:

  1. From dealing with the tables set up in flash memory, the MSP430's von Neumann architecture are obviously different than the AVR's Harvard architecture.   Reading a constant from flash on an AVR involves setting up particular register pairs and using a special "load program memory" instruction.  On the MSP430, flash is in the same address space as all the other memory, so the table reads are just ... normal "mov" instructions.  It's also nice to have a fundamental register size that matches the address space, and registers that are actually general purpose enough that any of them can be an index register.
  2. The regular layout of the registers controlling digital IO for each port reduces the amount of flash that needs to be used for the tables.  Actually, this would probably be true on the AVR as well, but optimising for space is less important there.  Food for thought, though...
  3. The MSP430 bit set and bit clear instructions use bitmasks rather than bit numbers.  This can mean that the "single instruction" to modify a bit on an IO pin can end up being 6 bytes long! (bis.b #128, &0x0021; one word (2 bytes) for the instruction, one for the immediate bitmask argument, and one for the IO register address.)  The "constant generator" allows single bits 0 through 3 to be modified using only a two-byte instruction, perhaps lending a bit of surprise to anyone expecting really tight timing.

 

Next up: Timers and PWM.

  • Sign in to reply
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 © 2026 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.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube