Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

programming atmega16a with cm8880

Status
Not open for further replies.

foxbrain

Full Member level 2
Joined
Feb 1, 2010
Messages
142
Helped
5
Reputation
10
Reaction score
4
Trophy points
1,298
Location
Damas
Activity points
2,322
hi
i'm tring to program atmega16a to be used with cm8880 so i can use it to dial numbers on a phone and my code is:
Code:
#include <avr/io.h>
#include <util/delay.h>
#include <stdbool.h> 
#define SETBIT(ADDRESS,BIT) (ADDRESS |= (1<<BIT)) 
#define CLEARBIT(ADDRESS,BIT) (ADDRESS &= ~(1<<BIT)) 
#define CHECKBIT(ADDRESS,BIT) (ADDRESS & (1<<BIT)) 
#define delay(a) _delay_ms(a) 

void setsend(void)
{
DDRD=0xFF;
PORTD=0xC0;
SETBIT(PORTD,4);
SETBIT(PORTD,5);
PORTD&=0xF9;
delay(60);
PORTD&=0xF0;
}
bool ready()
{
	DDRD=0xF0;
	SETBIT(PORTD,4);
	CLEARBIT(PORTD,5);
	while (!CHECKBIT(PIND,1))//check the b1 on the status register if ready to transmit
	{
		//asm "nop";
	}
	return true;
}
void dail()
{
	DDRD=0xFF;
	SETBIT(PORTD,5);
	CLEARBIT(PORTD,4);
	PORTD&=0xEA;
	PORTD&=0xE9;
	PORTD&=0xE5;
	PORTD&=0xE6;
	PORTD&=0xE5;
	PORTD&=0xE9;
	PORTD&=0xE2;
	PORTD&=0xE6;
	PORTD&=0xE8;
	PORTD&=0xE2;
}	

int main(void)
{
    setsend();
	while(1)
	{
		if (ready())
		{
			dail();
			break;
		}
		
	}
}
but the code is stocked in the while in the ready function....
so what might the problem be?
thanks
 

no one knows an answer for me....
heeeeeeeeeeeeeeeeeelp
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top