<< Chapter < Page Chapter >> Page >
Using the DMA controller included in the MSP-EXP430FG4618 Development Tool transfer a sinusoidal wave to the DAC12_0's output. Timer_A operates in upmode with TACCR1 loading DAC12_0 on rising edge and DAC12_0IFG triggering next DMA1 transfer. DAC12_0 uses internal 1.5V reference.

Laboratory dma: lab2 - sinusoidal waveform generator

Introduction

This laboratory gives an example of the use of the DMA peripheral available in the MSP-EXP430FG4618 Development Tool. It requires the configuration of the DMA Source and Destination Addresses Registers, DMA Size Address Register; DMA Control Registers, DMA Channel 0 Control Register, DAC12 control register and Timer_A control register in order to generate a sinusoidal waveform.

Overview

This laboratory ( Lab2_DMA.c ) uses the DMA controller to automatically transfer data between data memory and the DAC12 data register. A sinusoidal waveform is produced at the output of the DAC, without CPU intervention.

Resources

This laboratory uses the following peripherals:

- DMA controller;

- DAC;

- ADC (reference generator: V REF+ );

- Timer_A;

- Low power mode.

Software application organization

The successive samples needed to produce the sinusoidal waveform using the DAC are stored in the data vector Sin_tab , which contains 32 points:

//--------------------------------------------------------- // 12-bit Sine Lookup table with 32 steps//--------------------------------------------------------- int Sin_tab[32]= {2048, 2447, 2831, 3185, 3495, 3750, 3939, 4056, 4095, 4056, 3939, 3750, 3495, 3185, 2831, 2447,2048, 1648, 1264, 910, 600, 345, 156, 39, 0, 39, 156, 345, 600, 910, 1264, 1648};

The software begins by disabling the watchdog timer, followed by activating the internal reference voltage V REF+ . The source and destination registers of the data vector to be transferred by the DMA channel are loaded into the data vector Sin_tab (source) address and with the DAC12 data register (destination) address. There are 32 data values to be transferred.

The data transfer is initiated whenever the DAC12IFG flag is enabled. In this application, the DAC interrupt should be disabled.

The DMA controller is configured to operate in repeat mode, to transfer a word whenever the previous event occurs. The data source address is set to increment after each transfer, while the destination address must remain constant.

The timer is set to generate the PWM signal through the capture/compare unit TACCR1. SMCLK is the clock signal that counts up to the value in the TACCR0 register.

Finally, the settings and interrupts are enabled and the device enters into low power mode LPM0.

System configuration

Dac12 reference voltage activation

The DAC12 requires a reference voltage. One of the options is to use the internal voltage V REF+ . Set the ADC12CTLO register to activate this voltage:

ADC12CTL0 = REFON; // Internal reference

Dma controller configuration:

Configure the registers DMA0SA (source), DMA0DA (destination) and DMA0SZ (size) to transfer 32 words between the source vector Sin_tab and the DAC12_0DAT data destination register:

DMA0SA = (void (*)( ))&Sin_tab; // Source block addressDMA0DA = (void (*)( ))&DAC12_0DAT; // Destination single addressDMA0SZ = 0x20; // Block size

Configure the register DMACTL0 to provide a data transfer whenever the DAC12IFG flag is set:

DMACTL0 = DMA0TSEL_5; // DAC12IFG trigger

Configure the register DMA0CTL to carry out a repeated simple data transfer, increasing the data source address:

DMA0CTL = DMADT_4 | DMASRCINCR_3 | DMAEN; // Repeated single transfer,// DMA source address increment, // since DMASRCBYTE = 0, the source address increments by// two (word-word)

Setup dac12

The DAC12 will update its output whenever there is the activation of the signal TA1. The DAC full-scale should be 1x reference voltage. Choose a medium relationship between the DAC’s current and average conversion speed:

DAC12_0CTL = DAC12LSEL_2 | DAC12IR | DAC12AMP_5 | DAC12IFG | DAC12ENC; // Rising edge of Timer_A.OUT1 (TA1),// DAC12 full-scale output: 1x reference voltage, // Input and output buffers: Medium freq./current,// Enable DAC12

Timer_a configuration

Timer_A is responsible for synchronizing data transfers between memory and the DAC12. The Timer_A input receives as the SMCLK signal (1.048576 MHz) and must have a 30 msec counting period. What value needs to be written to TACCR0, in order to achieve this counting period:

TACCR0 = 32-1; // Clock period of TACCR0 TACTL = TASSEL_2 | MC_1; // SMCLK, continuous mode

The capture/compare unit TACCR1 should generate a PWM signal in set/reset mode. Configure the unit appropriately:

TACCTL1 = OUTMOD_3; // TACCR1 set/reset TACCR1 = 20; // TACCR1 PWM Duty Cycle

Analysis of operation

The verification of this laboratory is achieved by using an oscilloscope probe to monitor the output of the DAC12 Channel 0, available on header 8 pin 6.

This example and many others are available on the MSP430 Teaching ROM.

Request this ROM, and our other Teaching Materials here (External Link)

Questions & Answers

memory of development brain of the human psychologist
SERAJ Reply
?
lord
hlo
Ananya
Haw are you?
Shilan
hi
zge
hello
Emm
usef
hi
Gil
Haw are you?
Shilan
Aha ok
Shilan
hi
Daniella
waasup
Isaiah
hello
Sara
hello
androi
Haw are you
Shilan
im ok you
Daniella
Me to
Shilan
Thanks
Shilan
What's going?
Shilan
working
Daniella
hey everyone this Mahmoud
Mahmoud
is
Mahmoud
Fine
Shilan
Hello
Jobe
how is it going people?
Tomasz
kind
Alter
thanks
Alter
hi..!
Alter
yes we'll
Alter
yes we'll
Alter
how did psychology begin?
Valerie Reply
of psychologys commencement, the traces can be seen in the work of Aristotle, where he talk about soul and body, likewise work in durrant, de anima, all these were somewhere supporting dualism, in which soul could exist separately from body
amaan
but if you talk about the moder psychology, Gustav fechner, is credited with performing scientific experiments, basis of his experiments in psychology with his studies perception.
amaan
does psychology deal with love?
Mohammed Reply
Maybe, i think
edem
I definitely would say yes
Clara
how so
Isaiah
*triarchic
Meredith
there are so many different reasons why you can fall in love with someone, many of them develope subconsciously -> psychology
Clara
love messes with the brain, a lot, ergo I believe that Psychology does indeed deal with love
I would like an example as to what and how you think it deals with.
Tyler
how can I discover that this individual has a long-term memory and shot- term memory?
Namuaha
what is synapse
Katie Reply
In the central nervous system, a synapse is a small gap at the end of a neuron that allows a signal to pass from one neuron to the next. synapse are found where nerve cells connect with other nerve cells
Najeem
a synapse the connection is where a neuron cell connects to another neuron cell.
Shaun
good
Jobe
what is psychology
Jobe
can you do auto book auto
Mariah Reply
WHT u mean?
usef
yes
MD
heyy, may i join the conversation please?
edem Reply
yes of course
Najeem
how to avoid theory of bias confirmation in real life
Scar
yes
Jobe
hello
Bhavin
hello to all
Genevieve
hey, may I join the conversation?
samra
salaam
Ibrahim
so i cn even do this after ba hons in psychology?
Avneet
the only eligibility criteria is that you should have 50% of aggregate in your psychology papers. (bachelors)
syeda
okay thank you so much❤ have a lovely day🙂
Avneet
you're welcome. glad it helped ^_^
syeda
To pursue a career as a psychotherapist you'll have to do your bachelors in psychology. (bsc honors is preferable). since there are many fields and you've chosen as a therapist. a masters degree in clinical psychology or therapy and family counseling is preferable.
syeda
so i cn even do this after ba hons in psychology?
Avneet
yes you can.
syeda
you're welcome. glad it helped ^_^
syeda
hello
Vhikkie
yh
Parker
hello
Avneet
is there any psychotherapist here? i need to know the qualification one hve to pursue.
Avneet
I'm clinic psychologist...
Shilan
Hey. I'm pursuing BA in Clinical Psychology
Aakarshan
the only eligibility criteria is that you should have 50% of aggregate in your psychology papers. (bachelors)
syeda
hello
Vhikkie
who is the father of psychology
Richy Reply
aristatil
Ramadevi
and please, how would you guys, describe the study of psychology at college ?
edem
psychologist student?
Aspen
i mean not yet but am about to start college so wanna know how is it(college in general and psychology course) please
edem
Psychology is the study of mind and behaviour. So if you will take psychology as a subject so you will get to know how your everything (physical, mental, social, spiritual aspects) effects your behaviour
sakina
With this brief knowledge you can help people to cope up with their problems and only you can guide them correctly
sakina
And if you go for further specialisations you can study hypnosis, face reading, body language etc
sakina
Thanks a lot🙏🏾 And ik some of the stuffs u said but i am also going to write thesis, right ?
edem
ok no prob, thanks a lot🙏🏾✨
edem
cerebellum
Khan
hae everyone, hope you are well this evning my question is what is the difference between drive and motivation
Michael
good question
Rainee
drive is more like an impulse or urge and i think they both go together (drive and motivation) even if there is a slight difference
edem
@ Michael Drive is delivered to be innate without the use of an external stimuli, motivation normally evolves an outside stimuli which may include praise, appreciate, or reward.
Reginald
*believed...sorry for typo
Reginald
@Reginald, can't the motivation come from the inner self?
edem
Good question, please give an example.
Reginald
can we say desire of success for example
edem
Wilhelm Wundt is the father of psychology
ipau
Wilhem Wundt thank you for the road that you opened.
Qwanta
You mean who is the father of having a great educated argumentative guess? nothing is more wrong than this question. The question is you should ask yourselfs is, how sure are you abour their scientific studying? one's percieved assimilated approach to judging another person and saying they are
Roger
the biggest problem with scientific research and data is that ya you could get the same result 1000 times then it could go the other way 1000 times, but we would never know that and we did, we would still say ya but the proof is there. The only thing science proves is that humanity has
Roger
no facts about human behavior in the scientific context, but more in the trial and error.. sorry to tell you, but so far no one has proven Father of anything, thats up to you and i, judgement is bias, science is good enough lazy
Roger
cognitive development is the growing and development of the brain.
Jessy Reply
Anyone knows about Techno-fascism?
Hussein Reply
Ecofascism is a theoretical political model in which an authoritarian government would require individuals to sacrifice their own interests to the "organic whole of nature". The term is also used as a rhetorical pejorative to undermine the environmental movement.
ipau
what's the big difference between prejudice and discrimination?
Danice Reply
A prejudiced person may not act on their attitude.  Therefore, someone can be prejudiced towards a certain group but not discriminate against them.  Also, prejudice includes all three components of an attitude (affective, behavioral and cognitive), whereas discrimination just involves behavior
Nancy Lee
hi
basher
hello
Rahul
what is all about cognitive development?
Kamohelo
cognitive development is the growing and development of the brain
Jessy
how do you control a variable when using spss whilst running a pearsons correlation analysis?
Jessie Reply
it dependa on your study. according to what you want to say and explain your result
Pouran
Hello
Jobe
why does it say her and she
Jayla Reply
stages of cognitive development
brivia Reply
sensory preoperatinal concrete formal
Rajendra
What's mental memory?
Namuaha
Memory is our ability to encode, store, retain and subsequently recall information and past experiences in the human brain. It can be thought of in general terms as the use of past experience to affect or influence current behaviour.
Shilan
What I mental memory?
Namuaha
What's mental memory?
Namuaha
my thankful
Namuaha
Shilan I love your definition
Jobe
what is psychology
Chethani Reply
the study of insecurities and the effect on the host .
Sera
Psychology is the scientific study of behavior & mental processes
Angela
psychology is science about learning human behaviour
Zhamshid
behaviorosm
Khan
is the study of human behaviour and mental processes
Jobe
In thinking about the case of Candace described earlier, do you think that Candace benefitted or suffered as a result of consistently being passed on to the next grade?
Nene Reply
why not we create a boon page to aid one another please because my accessibility to this lage is minimal
Jobe
Got questions? Join the online conversation and get instant answers!
Jobilize.com Reply

Get the best Algebra and trigonometry course in your pocket!





Source:  OpenStax, Teaching and classroom laboratories based on the “ez430” and "experimenter's board" msp430 microcontroller platforms and code composer essentials. OpenStax CNX. May 19, 2009 Download for free at http://cnx.org/content/col10706/1.3
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Teaching and classroom laboratories based on the “ez430” and "experimenter's board" msp430 microcontroller platforms and code composer essentials' conversation and receive update notifications?

Ask