Discussion in "Project Help" started by    mayank058    Mar 27, 2015.
Fri Mar 27 2015, 12:16 pm
#1
Dear Sir,
I am working on MCB2300. I want to generate triangular wave using this board.so, please give me some idea for that. And I am not able to get any study material for that ..so please tell me from where to get the study material for that programme.
Sat Mar 28 2015, 10:18 am
#2
To answer it as vaguely as the question, you just need to make an up and down counter(so that it counts up then down then up then down and so on like that) and send the counter value to gpio port. Say if you want to see the wave physically and are using an 8 bit dac then u just need to count from 00 to ff to 00 to ff and so on and send each value of the counter using 8 gpio pins(or just 1 if you send serially and use sipo registers, then convert it back to parallel using piso then to dac) to the dac and u can see the wave physically on the cro; if u want to change the max amplitude of the wave then just change the counter max value, like for half max amplitude it would be 7f so run it like 00 to 7f to 00 to 7f and so on
Mon Mar 30 2015, 12:52 am
#3
Ianalien is right. But you can do this without using a DAC. You need to generate a PWM signal varying from 0 to 100 then again to 0. Simple...
Mon Mar 30 2015, 10:43 am
#4
The processor on the MCB2300 has a built in DAC.
Create a triangular waveform, by sending the up/down count that iamalien
described, to the DAC's count register at regular intervals.

Tue Mar 31 2015, 12:03 pm
#5
Thanks to all of u for showing your interest in my work...Mr Ajay sir, you told me the solution for generation of sine wave..so, how is it possible to generate both waves with a same theory..so, please tell me in details...


[ Edited Tue Mar 31 2015, 12:04 pm ]
Tue Mar 31 2015, 12:14 pm
#6
Dear Iamalien,
Thank you for your reply..I worked on your solution, but still not able to generate wave on CRO actually the problem is I am not able to use DAC in MCB2300.I can start DAC and generate output but not able to sent the generated output at AOUT pin.. so, tell me how to use DAC.
Fri Apr 03 2015, 03:58 pm
#7
For sinewave I think we used PWM you can use same PWM module for generating triangular wave. start your duty cycle from 0 to 100 then back to 0%. Its very simple and less complicated than sine wave. For DAC, Post your program lets see if there is any issue on initializing DAC.
Thu Apr 16 2015, 02:57 pm
#8
dear sir,
The generated triangular wave is not so clear. amplitude of that triangular wave is too less. so tell me the the method in details and I am posting my simple code for DAC . Tell me how to take output on CRO using that code.
#include<lpc23xx.h>
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++);


[ Edited Fri Apr 17 2015, 06:17 pm ]
Thu Apr 16 2015, 11:09 pm
#9
The DAC is 10 bit.
Try for(i=0;i<0x3ff;i++) instead.

"PINSEL1 |= 0x00200000;// to use P0.25 as DAC output pin."
You need to set two bits here
0x00200000 high and 0x00100000 low.
If 0x00100000 is already 1, PINSEL1 |= 0x00200000; will not clear it.


[ Edited Sat May 16 2015, 02:30 am ]
Fri Apr 17 2015, 10:19 am
#10
dear sir,
Actually DAC output pin is 0.26..so I think bit 21 must be set to get output on PIN 0.26. In simulation everything went good but I am not able to get output on CRO by using the board.

Get Social

Information

Powered by e107 Forum System

Downloads

Comments

EdwardFew
Mon Mar 18 2024, 01:14 pm
EmeryPah
Mon Mar 18 2024, 11:51 am
RobertMax
Sun Mar 17 2024, 10:22 pm
DanielJar
Fri Mar 15 2024, 06:52 pm
Tuzaimecor
Fri Mar 15 2024, 02:32 am
PromotionFoode
Thu Mar 14 2024, 08:11 pm
EdwardGeawn
Sun Mar 10 2024, 12:24 pm
ZacharyShado
Sat Mar 09 2024, 10:04 am