Commit 2de77654 authored by Sergi Hernandez's avatar Sergi Hernandez
Browse files

Enabled the internal pull-ups for the I2C pins.

Removed any write to the I2C pins to avoid communication errors.
parent 448b46d9
......@@ -14,7 +14,7 @@ void InitGPIO(void)
// Pc3 as an input (OVP)
PORTC=0x00;
PORTC=PORTC&0xF0;
}
void enable_battery(void)
......
......@@ -51,8 +51,8 @@ void i2cInit(void)
{
// set pull-up resistors on I2C bus pins
// TODO: should #ifdef these
// sbi(PORTC, 5); // i2c SCL on ATmega163,323,16,32,etc
// sbi(PORTC, 4); // i2c SDA on ATmega163,323,16,32,etc
sbi(PORTC, 5); // i2c SCL on ATmega163,323,16,32,etc
sbi(PORTC, 4); // i2c SDA on ATmega163,323,16,32,etc
// sbi(PORTD, 0); // i2c SCL on ATmega128,64
// sbi(PORTD, 1); // i2c SDA on ATmega128,64
......
......@@ -41,6 +41,7 @@ int main (void)
// initialize the GPIO
InitGPIO();
// initialize uart
uartInit();
// set desired baud rate in bps
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment