Assembly Language Programming: Difference between revisions

From Class Wiki
Jump to navigation Jump to search
Line 80: Line 80:


====Toolchain====
====Toolchain====
=====Code Composer Studio=====
*[http://processors.wiki.ti.com/index.php/Download_CCS CCS] will work with Linux and Windows, and now a [https://e2e.ti.com/blogs_/b/toolsinsider/archive/2015/03/20/code-composer-studio-beta-for-msp430 beta] is available for OS X.
*[http://processors.wiki.ti.com/index.php/Download_CCS CCS] will work with Linux and Windows, and now a [https://e2e.ti.com/blogs_/b/toolsinsider/archive/2015/03/20/code-composer-studio-beta-for-msp430 beta] is available for OS X.
**To install CCSV6.1 on Ubuntu 15.04, you need to
**To install CCSV6.1 on Ubuntu 15.04, you need to
Line 86: Line 87:
**[http://www.ti.com/general/docs/lit/getliterature.tsp?baseLiteratureNumber=slau157 Code Composer Studio 6 for MSP430 User's Guide]
**[http://www.ti.com/general/docs/lit/getliterature.tsp?baseLiteratureNumber=slau157 Code Composer Studio 6 for MSP430 User's Guide]
**[https://www.youtube.com/playlist?list=PL3NIKJ0FKtw67hHMKWN2xBfecpei-1wVg 73 Short Videos on using Code Composer Studio]
**[https://www.youtube.com/playlist?list=PL3NIKJ0FKtw67hHMKWN2xBfecpei-1wVg 73 Short Videos on using Code Composer Studio]
*[https://dev.ti.com/ TI Cloud Tools] This includes CCS Cloud which allows you to compile ,flash, and even debug. It seems to be under rather rapid development, so though it is missing a number of features of the local IDE, it may receive those any time.
*[https://code.google.com/p/osx-launchpad/ OS X Native Toolchain Installer] (You may prefer the Code Composer Studio Beta linked above.)
=====MSP430 Assembly using the TI Assembler=====
*[http://www.ti.com/lit/ug/slau131i/slau131i.pdf Assembly Language Tools] This manual also has some good data on the linker, including the section "Using Linker Symbols in C/C++ Applications".
*[http://www.ti.com/lit/ug/slau131i/slau131i.pdf Assembly Language Tools] This manual also has some good data on the linker, including the section "Using Linker Symbols in C/C++ Applications".
*[https://students.cs.byu.edu/~cs224ta/references/Code%20Composer%20Studio/asm/MSP430%20Assember%20Directives.pdf Assembler Directives]
*[https://students.cs.byu.edu/~cs224ta/references/Code%20Composer%20Studio/asm/MSP430%20Assember%20Directives.pdf Assembler Directives]
*[http://www.iups.org/media/meeting_minutes/C.pdf Kernighan and Ritchie's Famous C Book] This is probably the best short text for learning C.
*[http://www.ti.com/lit/ug/slau132j/slau132j.pdf MSP430 Optimizing C/C++ Compiler] (See Section 6.5 and following for how to mix C/C++ and Assembly. It is really best to read the entire chapter though, as it is all pertinent to mixing C and Assembly. It will also help you if you want to program in C, as it tells how the C compiler uses the memory, the stack, the registers, etc., and once you understand the processor as you learn to do when you learn its assembly language, it is very interesting to see how that all works in C.)
*[http://www.ti.com/lit/ug/slau132j/slau132j.pdf MSP430 Optimizing C/C++ Compiler] (See Section 6.5 and following for how to mix C/C++ and Assembly. It is really best to read the entire chapter though, as it is all pertinent to mixing C and Assembly. It will also help you if you want to program in C, as it tells how the C compiler uses the memory, the stack, the registers, etc., and once you understand the processor as you learn to do when you learn its assembly language, it is very interesting to see how that all works in C.)
**[http://processors.wiki.ti.com/index.php/Printf_support_for_MSP430_CCSTUDIO_compiler Here] is how to use printf() statements with Code Composer Studio.
**[http://processors.wiki.ti.com/index.php/Printf_support_for_MSP430_CCSTUDIO_compiler Here] is how to use printf() statements with Code Composer Studio.
*[https://dev.ti.com/ TI Cloud Tools] This includes CCS Cloud which allows you to compile ,flash, and even debug. It seems to be under rather rapid development, so though it is missing a number of features of the local IDE, it may receive those any time.
*[https://code.google.com/p/osx-launchpad/ OS X Native Toolchain Installer] (You may prefer the Code Composer Studio Beta linked above.)
=====GCC Compiler=====
=====GCC Compiler=====
*[http://e2e.ti.com/support/wireless_connectivity/f/968/p/388802/1373125#1373125 Some notes on getting the GCC compiler to work with the CC3100....]
*[http://e2e.ti.com/support/wireless_connectivity/f/968/p/388802/1373125#1373125 Some notes on getting the GCC compiler to work with the CC3100....]
Line 102: Line 103:
**[http://stackoverflow.com/questions/3898435/labels-in-gcc-inline-assembly Labels in inline assembly with GCC]
**[http://stackoverflow.com/questions/3898435/labels-in-gcc-inline-assembly Labels in inline assembly with GCC]
*[http://www.ti.com/lit/an/slaa334a/slaa334a.pdf How Flash works, and how you can write to it from your program.]
*[http://www.ti.com/lit/an/slaa334a/slaa334a.pdf How Flash works, and how you can write to it from your program.]
=====C Language References=====

====Evaluation Board Data====
====Evaluation Board Data====
*[http://www.ti.com/tool/msp-exp430f5529lp MSP430 F5529 LaunchPad Evaluation Kit Resource Page]
*[http://www.ti.com/tool/msp-exp430f5529lp MSP430 F5529 LaunchPad Evaluation Kit Resource Page]

Revision as of 11:36, 3 December 2015

Useful Links for the Assembly Language Programming Class

ARM7 Links

Raspberry Pi

Depending on the version, your pi may use ARM6 or ARM7. There is actually quite a lot of good assembly language information for programming the raspberry pi.

TI MSP430 Links

Code Examples from Class

Other Course Materials for the MSP430 Family

Slides 2015

These slides were modified from Mark Clement's work at BYU.

Toolchain

Code Composer Studio
  • CCS will work with Linux and Windows, and now a beta is available for OS X.
    • To install CCSV6.1 on Ubuntu 15.04, you need to
$ unset JAVA_TOOL_OPTIONS 

before running the installer. There is some more information for Linux installs here. I also found out that installing Grace from the App Center makes the App Center blank thereafter, unless you reinstall CCSV6.1.

MSP430 Assembly using the TI Assembler
  • Assembly Language Tools This manual also has some good data on the linker, including the section "Using Linker Symbols in C/C++ Applications".
  • Assembler Directives
  • MSP430 Optimizing C/C++ Compiler (See Section 6.5 and following for how to mix C/C++ and Assembly. It is really best to read the entire chapter though, as it is all pertinent to mixing C and Assembly. It will also help you if you want to program in C, as it tells how the C compiler uses the memory, the stack, the registers, etc., and once you understand the processor as you learn to do when you learn its assembly language, it is very interesting to see how that all works in C.)
    • Here is how to use printf() statements with Code Composer Studio.
GCC Compiler
C Language References

Evaluation Board Data

CC3100 SimpleLink Wi-Fi Family

2014 Robot Information

  • HSR-1425CR Continuous Rotation Servo Datasheet
  • Schematics These are rather crude schematics of the robot circuit board. There are two cuts and jumps that are not reflected, at least on the last one. The effect is to change the photo transistors from a common emitter to a common collector configuration. You can see the change scratched in just below the word Fairchild on the hand drawn schematic. Basically the resistor and photo transistor are reversed in order. I believe both photo transistors are swapped to common collector configuration.

2015 Robot Information

  • Building Tips
  • L9110 H Bridge Data Sheet
    • HG7881 Dual H Bridge Module This suggests putting the PWM signal on one input and the direction control on the other. If you do that, you need to invert the PWM input when you change directions as well. See the data sheet above.
  • Bluetooth UART HC-05 and HC-06
  • Blueberry Android Bluetooth Remote Control App
  • HY301-07A Photo Interrupter Datasheet From the datasheet, we will choose a forward current on the LED to be 5 mA because we don't want to waste batteries, and that is the lowest the data sheet shows it working. That leads us to a forward voltage across the diode of 1.3 volts. If we run things on 3.3 volts that gives us a voltage drop of 3.3-1.3=2.0 volts. Ohms law says a resistor of R=V/I=2volts/5mA = 400 ohms. We will pick 390 ohms since it is an available 5% value. For the phototransistor, we see that the current for the forward diode current we picked should be about 0.2 mA. If we want the output to drop to 0.5 volts with the LED on, that leaves 3.3 volts - 0.5 volts = 2.8 volts across the collector resistor, so using Ohm's Law again, we need a collector resistor of 2.8 volts/0.2mA = 14 Kohms, so we will pick 15 Kohms because it is a standard value. The 15 Kohm resistors are optional as you can use the built in ones on the MSP430 controlled by PREN.
  • I count 20 holes, on the encoder wheels. This gives 20 periods per revolution. The wheel diameter is about 0.066 meters, so the radius is 0.033 meters. This gives about 0.21 meters per revolution. It seems a pretty fast speed is about 1 meter per second, which means that we have about 5 revolutions per second, or 100 cycles per second, or about 0.01 seconds per period at high speed.
  • Applying Feedback makes the robot easier to control. This web page gives a somewhat helpful primer on that process.

Logic Analyzer Information

These logic analyzers are clones of the original Saleae analyzer. They have software compatible with this analyzer, but they don't like you to use it.

450

===Other Miscellaneous Interesting Reading===*Code: The Hidden Language of Computer Hardware and Software by Charles Petzold This is a good read about the history of the subject which gives the reader a good understanding of the subject.