Microcontroller › AVR › By using GSM SIM 300M and Atmega8 , How to write coding for sending SMS to 3 Persons when any one the port pin gets high …? › You forget to initialize the
November 3, 2012 at 5:26 am
#8713
AJISH ALFRED
Participant
You forget to initialize the port B. Port B should be set as input port.
Define the following function and call it from the main() before “while ( PIN == 0 );”
void init_Ports(void)
{
CLI(); //disable all interrupts
DDRB = 0x00; //port B as input
SEI(); //reanable all interrupts
}
On reset condition I think the ports are input by default, but try this too and update the result.
Also tell me how are you giving a logic high to PB0 pin, I mean the circuit connected to PB0 pin.