Skip to content Skip to navigation

OpenStax-CNX

You are here: Home » Content » Lab 8: DMA + RS232

Navigation

Lenses

What is a lens?

Definition of a lens

Lenses

A lens is a custom view of the content in the repository. You can think of it as a fancy kind of list that will let you see content through the eyes of organizations and people you trust.

What is in a lens?

Lens makers point to materials (modules and collections), creating a guide that includes their own comments and descriptive tags about the content.

Who can create a lens?

Any individual member, a community, or a respected organization.

What are tags? tag icon

Tags are descriptors added by lens makers to help label content, attaching a vocabulary that is meaningful in the context of the lens.

This content is ...

Affiliated with (What does "Affiliated with" mean?)

This content is either by members of the organizations listed or about topics related to the organizations listed. Click each link to see a list of all content affiliated with the organization.
  • TI MSP430 display tagshide tags

    This module is included inLens: Texas Instruments MSP430
    By: Texas InstrumentsAs a part of collection: "Microcontroller and Embedded Systems Laboratory"

    Comments:

    "Basic introduction to microcontroller-based embedded systems development. Includes structured laboratory exercises in the following areas: assembly programming, C language programming, peripheral […]"

    Click the "TI MSP430" link to see all content affiliated with them.

    Click the tag icon tag icon to display tags associated with this content.

Recently Viewed

This feature requires Javascript to be enabled.

Tags

(What is a tag?)

These tags come from the endorsement, affiliation, and other lenses that include this content.
 

Lab 8: DMA + RS232

Module by: adrian valenzuela. E-mail the author

Summary: Lab 8 deals with the benifits of using DMA and using RS232 as a communication protocol.

Direct memory access is a system to transfer data between peripheral modules and memory without using processor instructions. While its operation does occupy the memory bus, far fewer instructions require CPU interaction. This allows the CPU to work on other tasks simultaneously, or it may be be put into a low power mode.

Exercise 1

DMA Powered Voltmeter

The DMA module allows you to automatically move data between memory locations. This will also allow us to automate much of your program's execution.

  1. Set up the DMA module to automatically transfer the data from the ADC to the DAC. Transfer the input from the ADC1 to DAC0 and ADC0 to DAC1. Sampling should be interrupt enabled.
  2. Measure the peak-to-peak amplitude of the input signal to ADC0 using the processor. Units are irrelevant. Display the amplitude on the seven segment display. You should have at least 4 different possible levels.

Exercise 2

RS232

We will configure the serial port (RS232) to transmit data. Just like before create a new project and do the following: disable the watchdog timer, and initialize the master clock and i2c. This should now be standard for all new projects. To set up the UART to use RS232 we must set the following registers:

  • Reset UICTL (on its own line of code)
  • Set the character length to 8-bits
  • Set U1TCTL to enable ACLK as the BRCLK clock.
  • The baud rate should have the following settings: U1BR0 = 0x7c; and U1BR1 = 0x01; This will set the baud rate at 19,200 bits per second.
  • Set ME2 to enable both transmit and receive.
  • Enable UART_TX and UART_RX on the msp (Hint: use P3SEL)
  • Set UART_TX as an output pin.

To transmit data, check if the UTXIFG1 flag is set in UTXIFG1. Once the flag is set you may write directly to TXBUF1, and that data will be transmitted. Now, come up with an array of ASCII characters in hexadecimal notation, and load each character in the TXBUF1 one at a time. Don't for get to add a new line character, /n, at the end of your message.

To test your project open up HyperTerminal, and set the correct baud rate (19200). All other default settings should be fine. If you correctly configured the UART then you should see your message in the terminal.

Once you have verified that you can transmit data to the serial port, load the TXBUF1 via DMA. You may trigger the DMA any way you wish. This will eliminate most of the work that the processor has to do.

Exercise 3

Modify the first problem so that you input something into ADC0 and DMA the samples to the serial port. Come up with some way for a computer to read those values, HyperTerminal or otherwise.

Content actions

Download module as:

Add module to:

My Favorites (?)

'My Favorites' is a special kind of lens which you can use to bookmark modules and collections. 'My Favorites' can only be seen by you, and collections saved in 'My Favorites' can remember the last module you were on. You need an account to use 'My Favorites'.

| A lens I own (?)

Definition of a lens

Lenses

A lens is a custom view of the content in the repository. You can think of it as a fancy kind of list that will let you see content through the eyes of organizations and people you trust.

What is in a lens?

Lens makers point to materials (modules and collections), creating a guide that includes their own comments and descriptive tags about the content.

Who can create a lens?

Any individual member, a community, or a respected organization.

What are tags? tag icon

Tags are descriptors added by lens makers to help label content, attaching a vocabulary that is meaningful in the context of the lens.

| External bookmarks