Discussion in "ARM Development" started by    mayank058    May 14, 2015.
Thu May 14 2015, 04: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, 04: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, 09: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, 04: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, 07: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, 09: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, 06: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, 04:16 PM
#8
Does the speaker work?.

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

Get Social

Information

Powered by e107 Forum System

Conversation

Tue Jan 14 2020, 07: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
Tue Dec 17 2019, 01:44 PM
Devangi
hello..i am programming industrial timer using 8051 with 24lc64 eeprom. i have query in storing the 3 diff value in eeprom with enter button. can anyone share c code ?
Tue Dec 17 2019, 10:30 AM
Andrius
Hello. Can anyone share the code in Bascon and scheme in Proteus?
Thu Nov 21 2019, 12:30 PM
raj2555
how to interface 8051 microcontroller with NRF24L01+ module
ExperimenterUK
Sat Oct 12 2019, 10:23 PM
Log in.. then post your code in the 8051 forum
Sat Oct 12 2019, 10:18 AM
Bhadra Sajikumar
i am doing a countdown timer with 8051 for my project, unfortunately our professor had to take a leave of absence before he could teach us most of it.. can someone explain the .asm code of it for me?
Mon Sep 23 2019, 07:37 AM
Nathaniel
I am doing a project for my schools wireless security system with cameras,sensors and spot lights using 8051 micro controller, could you help me out with the design and its source code.
Wed Sep 18 2019, 08:48 PM
Caryn Kover
Thank you for your time,
ExperimenterUK
Mon Aug 05 2019, 07:09 PM
@Ismail ..post in forum, give details
Mon Aug 05 2019, 04:33 PM
Ismail balghmi
Hello. Please I won't download

Downloads

Comments

usb5962
Sat Jan 11 2020, 10:42 AM
elt
Tue Jan 07 2020, 06:53 PM
mg3914697
Tue Jan 07 2020, 12:42 PM
afds43
Sun Dec 29 2019, 05:54 AM
Rupeshpatil
Fri Dec 27 2019, 06:14 PM
pyxus
Sat Dec 14 2019, 12:31 PM
Istika
Thu Dec 12 2019, 12:04 PM
nabiha_anaya
Sun Dec 08 2019, 09:16 AM

Online

Guests: 32, Members: 0 ...

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

Members: 38115
Newest member: usb5962
Forum Activity
Billz Avatar
Posted By Billz
Sat Jan 11 2020, 05:43 PM
hi everyone please attached files are my c code fo...
ExperimenterUK Avatar
Posted By ExperimenterUK
Tue Jan 07 2020, 08:18 PM
Not a stupid question.Setting up "Eclipse" can be...
elt Avatar
Posted By elt
Tue Jan 07 2020, 07:06 PM
So i have just began learning programming micros a...
Billz Avatar
Posted By Billz
Mon Jan 06 2020, 09:22 PM
I think it would be better if you guys try to come...
ExperimenterUK Avatar
Posted By ExperimenterUK
Mon Jan 06 2020, 12:22 AM
Can you post a circuit diagram and any code you ha...
Billz Avatar
Posted By Billz
Sun Jan 05 2020, 08:17 PM
Need help regarding C code (specifically for PIC 1...
ExperimenterUK Avatar
Posted By ExperimenterUK
Mon Dec 30 2019, 06:42 PM
Can you give more details of your problem.
Rupeshpatil Avatar
Posted By Rupeshpatil
Fri Dec 27 2019, 06:21 PM
How to copy program my old microcontroller to new ...
ilylily07 Avatar
Posted By ilylily07
Thu Dec 12 2019, 02:26 PM
wil do.thank you for your advice!
ExperimenterUK Avatar
Posted By ExperimenterUK
Thu Dec 12 2019, 07:13 AM
Something like this ?https://www.bing.com/videos/s...