Hello, I'm Antonis (I'm studying Automation Engineering in Thessaloniki, Greece)
It' s my first post here and I really need your help
First, of all this project -> to create an analog signal was my idea
My professor told me that this project should be done with that micro-controller (MSP430G2553).
So my thinking is to
1. input 12bit from deep switch ->use them as a StartingNumber
2. these 12bit StartingNumber to increase till reaches 2^12 (=4096)
3. then decrease till 0. This way to create a digital triangle signal
4. that digital signal goes to a DAC7611p , so to output an analog signal
On CCS,
void main (void)
{
WDTCTL=WDTPW+WDTHOLD;
P1DIR &=~ 0xFF; //input Port1
P2DIR &=~ 0x78; //input P2.3-P2.6, so 12 bits input
P2DIR |= 0x07; //Output P2.0-P2.2
P1REN |=0xFF; //enable pull-up resistor
P2REN |= 0x78;
// using FOR or WHILE to increase till 4095, maybe something like while((P1IN!=0xFF) && (P2IN!=0x78))
{StartingNumber++;}
// now another to FOR or WHILE to decrease
{StartingNumber--;}
If you have anything to propose, anything that I need to read (apart from data sheets, that I already did), would be thankful !