Discussion in "ARM Development" started by    mayank058    May 14, 2015.
Thu May 14 2015, 12:38 AM
#1
Dear Sir,
I am using LPC2378 microcontroller in some project. I want to use 10-bit DAC available on this MC to convert some pulse wave into analog wave. So please tell me how to program it.
Thu May 14 2015, 12:47 AM
#2
Did you look at LPC23xx user manual and datasheet? If not then please check it once and We will help you implement the code, do let us know if you face any issue in understanding datasheet.
Thu May 14 2015, 05:31 AM
#3
Dear Sir,
I know that user manual is very help full. but in LPC2378's user mannul ,information related to DAC is very less and complex.That's why I am asking to you. Actually I did some example program for DAC but problem is that when I used the code on board no output was available at output PIN.
Fri May 15 2015, 12:42 AM
#4
Well the information in User manual is enough as there is nothing much to be done in DAC. its a 10-bit DAC and very simple to configure using just one register (DACR).
DACR has two fields to configure:
1. VALUE: this value is a 10-bit field sets the output voltage at Aout pin. The output voltage is Value/1024 * Vref
where Vref is the reference voltage at Vref pin of controller. So if your Vref is say 3.3 and you set Value as 500 then output voltage will be = 500 * 3.3 / 1024 = 1.61V
2. BIAS: This field selects the output current and the settling time of voltage at Aout pin. You have option to select settling time between 1uS or 2.5uS with 700uA and 350uA output current respectively.

That is for the DAC configuration. Apart from this you need to also configure the PINSEL register for P0.26 pin and configure it as Aout so that you can see the out coming on port pin. Do attach your code so we review what you've done.
Tags LPC23xx DACLPC2378 DACLPC23xx digital to analog converter
Fri May 15 2015, 03:24 AM
#5
dear sir
I had done all these things. I am posting my code. the problem is that,when I use this program on board and take output on CRO then no output was available on CRO only a line was there on CRO screen.
void delay(void);

int main()
{ int i;
PINSEL1 |= 0x00200000;// to use P0.25 as DAC output pin.

while(1)
{
for(i=0;i<0xff;i++)
{ /* Generate rising edge */
delay();
DACR = (i << 6) | (1<<16);
}
for(i=0xfe;i>0x00;i--)
{/* Generate falling edge */
delay();
DACR = (i << 6) | (1<<16); //data output to port B
}
}
}


void delay(void)
{
int k;
for(k = 1;k<= 100;k++);

}
Fri May 15 2015, 05:54 AM
#6
try to set a single value first. to make sure DAC is working fine.
PINSEL1 |= 0x00200000;
DACR = (1 << 16) | (500 << 6);
while (1);

This should give you 1.61V at Aout pin assuming Vref at 3.3V
Mon May 18 2015, 02:01 AM
#7
dear sir,
when I use your code on the board and measure output,Output was 3.3V. The program was going well in simulator. But not on the board.
Mon May 18 2015, 12:16 PM
#8
Does the speaker work?.

'Exactly' where on the board are you measuring ?.
Tue May 19 2015, 12:54 AM
#9
Sir I want to measure the analog signal on CRO.
Wed May 20 2015, 12:57 AM
#10
can you zip your complete project and attach it here?

Get Social

Information

Powered by e107 Forum System

Conversation

scena
Tue May 19 2020, 06:29 PM
Does anyone have microcontroller programming software for STC15F104W (core 8051, 4 k, 128 byte, 6 I/O pin, UART ... DIL8), that works?
Sat May 02 2020, 03:38 PM
Tamu Gurung
Hi I am looking for a assembly language program for a digital decimal counter. Time counts max limit of 2 mins starting from 2.00 mins and ending at 0.00. time is to be displayed on 4 7-segment LED displays. Edsim51 simulator to be used. Thanks
Wed Mar 25 2020, 09:39 AM
Tajammul
Sir kindly send the code file i2c for 8051
ExperimenterUK
Fri Mar 13 2020, 06:36 PM
@ Rohitnani,ABEBE..which project ?
Fri Mar 13 2020, 08:55 AM
ABEBE
how can get hadwere of this project
Rohitnani
Sat Mar 07 2020, 12:11 PM
Sir, Could you please send me the zip file input password....
Wed Feb 26 2020, 11:58 AM
Peter Parker
Is it possible to send multiple messages using only 1 GSM module?
Sat Feb 01 2020, 05:12 AM
Pearl Olin
Hello,
Wed Jan 22 2020, 01:16 PM
MINU CHAUDHARY
I m getting errors while simulation process during interfacing socket output and lcd... Can i get the report of ur project which is same as us.
Tue Jan 14 2020, 02:08 AM
shubham kharade
when i am trying to simulate the program in Proteus 8 professional, I am getting some errors as cannot find module file dhtxx.md can u help me

Downloads

Comments

Davidthils
Thu May 21 2020, 08:44 AM
Jakeror
Wed May 20 2020, 09:28 PM
motorCar
Wed May 20 2020, 03:05 PM
Vordrync
Wed May 20 2020, 07:52 AM
JadenjiT
Wed May 20 2020, 03:15 AM
scena
Tue May 19 2020, 06:08 PM
CodySiz
Tue May 19 2020, 02:22 PM
ClaireSat
Mon May 18 2020, 09:50 PM

Online

Guests: 70, Members: 0 ...

most ever online: 182184
(Members: , Guests: 182184) on 06 Aug 2010: 01:37 AM

Members: 38211
Newest member: Davidthils
Forum Activity
xrxx Avatar
Posted By xrxx
Thu Apr 30 2020, 06:59 AM
BCD MULTIPLICATIONAssume that you have to 2 BCD nu...
liqian Avatar
Posted By liqian
Tue Apr 28 2020, 05:26 AM
I happened to see your post and I got many useful ...
ExperimenterUK Avatar
Posted By ExperimenterUK
Tue Apr 28 2020, 04:21 AM
The code is hard to read.Please zip it and attach ...
rogermado Avatar
Posted By rogermado
Sun Apr 26 2020, 01:53 AM
@ExperimenterUK, thanks for your reply. You'll fin...
ExperimenterUK Avatar
Posted By ExperimenterUK
Sat Apr 25 2020, 05:42 PM
Some simulators handle displays better than others...
rogermado Avatar
Posted By rogermado
Sat Apr 25 2020, 03:59 PM
Hello everyone, sorry in advance if i'm not in the...
PHANTOM28 Avatar
Posted By PHANTOM28
Fri Feb 28 2020, 10:25 AM
Hi.I hope you all can help me. I am relatively ne...
ExperimenterUK Avatar
Posted By ExperimenterUK
Fri Feb 21 2020, 05:05 PM
ajay_bhargav Avatar
Posted By ajay_bhargav
Fri Feb 21 2020, 04:45 AM
Yes you can do that.1. Create a channel @Thingspea...
ananyagupta Avatar
Posted By ananyagupta
Thu Feb 20 2020, 03:58 AM
With regards to the particular characters sent to ...