User Tools

Site Tools


tutorials:microcontroller_programming_tips

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
tutorials:microcontroller_programming_tips [2024/10/29 20:30] ibchadmintutorials:microcontroller_programming_tips [2024/10/29 20:32] (current) ibchadmin
Line 1: Line 1:
 ====== Microcontroller Programming Tips ====== ====== Microcontroller Programming Tips ======
  
-When programming microcontrollers, a few things will be different from what you’re used to on a laptop.+When programming microcontrollers, a few things will be different from what you’re used to on a laptop.  The tips written below assume you are working on an [[microcontrollers:msp430|MSP430]], but is broadly applicable to most microcontrollers used in intermittent/batteryless contexts as well.
  
 **Registers:** You will often be interacting with hardware by writing to and reading from registers. These registers have names, just like variables. Often you will use bit-wise operations, like & and | to set or clear a single bit in the register. **Registers:** You will often be interacting with hardware by writing to and reading from registers. These registers have names, just like variables. Often you will use bit-wise operations, like & and | to set or clear a single bit in the register.
Line 23: Line 23:
 Note, that recursion, deep function call graphs, and passing large arrays or structs as parameters are similarly dangerous. You want to keep your stack small, so it doesn’t run over your globals. Note, that recursion, deep function call graphs, and passing large arrays or structs as parameters are similarly dangerous. You want to keep your stack small, so it doesn’t run over your globals.
  
-**FRAM:** RAM may be tight, but you do have FRAM to use. FRAM is like Flash memory (it’s nonvolatile) but faster and less complicated to use. On the MSP430s, your code is stored in FRAM, and the remaining FRAM is available for data that you want to keep around even if your device reboots. +**FRAM:** RAM may be tight, but you do have FRAM to use. FRAM is like Flash memory (it’s nonvolatile) but faster and less complicated to use. On the MSP430s, your code is stored in FRAM, and the remaining FRAM is available for data that you want to keep around even if your device reboots.
  
tutorials/microcontroller_programming_tips.1730233813.txt.gz · Last modified: 2024/10/29 20:30 by ibchadmin

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki