EngineersGarage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise
You are here: Home / Replies / You forget to initialize the

You forget to initialize the

|

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.

RSS Recent Posts

  • Can I make two inputs from one?? June 17, 2025
  • Photo interrupter Connections June 17, 2025
  • Is AI making embedded software developers more productive? June 17, 2025
  • Why can't I breadboard this oscillator? June 17, 2025
  • Cataract Lens Options? June 16, 2025

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2025 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy | Advertising | About Us

Search Engineers Garage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise