jhdoddans - MSP430 microcontroller basics: Solutions to...

Info iconThis preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon
MSP430 microcontroller basics: Solutions to odd-numbered examples John H. Davies June 25, 2008
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
CHAPTER 1 Embedded electronic systems and microcontrollers Example 1.1 I counted: remote controls (4), digital TV box, the TV itself, videocassette recorder, DVD player, cordless telephone and its base, which includes an answering ma- chine. That’s 10, which I suspect is a modest total – no MP3 players or games consoles! The base unit for the cordless telephone may contain two embedded systems, one for the telephone and another for the answering machine. Similarly, the television may have sep- arate systems for controlling reception and teletext (a system for broadcasting information between the visible frames of a television signal). Example 1.3 The data memory has a 9-bit address bus so there are 2 9 = 512 = 0x200 possible locations, with addresses from 0x000–0x1FF. Similarly, the program memory has a 13-bit bus and can therefore address up to 2 13 = 8K = 8096 = 0x2000 locations. 1
Background image of page 2
CHAPTER 2 The Texas Instruments MSP430 Example 2.1 Unfortunately you won’t be able to answer this accurately until you have reached the end of the book because it requires knowledge of all the modules. Here’s my suggestion, which comes to a total of 40 or 42 pins – a lot more than the 14 that are actually provided! •Two pins for power, V CC and V SS .A further two pins could be added if the analog and digital supplies were separate. •Two pins for the crystal, XIN and XOUT. •Two pins for the clock outputs, ACLK and SMCLK. • One pin for the reset or non-maskable interrupt, RST / NMI. •Ten pins for the input/output ports, P1.0–P1.7 and P2.6–P2.7. •Five pins for Timer_A: the input clock TACLK and an input and output for each of channel 0 and channel 1. • Eleven pins for the ADC: two for each of the five input channels, such as A0 ± , plus one for the reference VREF. • Three pins for communications, because there is only one peripheral (USI) so it cannot drive SPI and I²C simultaneously. This means that SCLK, SDO/SCL and SDI/SDA are sufficient. 2
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
The Texas Instruments MSP430 3 •Four pins for debugging because you could not use the four-wire and two-wire (Spy- Bi-Wire) interfaces simultaneously, nor would the TEST pin be needed if the pins had only one function. Therefore TCK, TMS, TDI/TCLK and TDI would be sufficient and two of these could be used for Spy-Bi-Wire. Example 2.3 Reading the input register, such as P1IN, always shows the state of the pins. This can obviously be different from P1OUT for a pin that is configured as an input. They can also differ if an output pin is overloaded and is unable to provide the voltage desired. If a single register is used, such as P1DATA, reading and writing do not work in the same way. Writing to P1DATA corresponds to writing to P1OUT and reading from P1DATA is like reading P1IN for a pin that is configured as an input. That is straightforward but there are two options for reading from P1DATA for a pin configured as an output. It may return
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 22

jhdoddans - MSP430 microcontroller basics: Solutions to...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online