Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
labrobotica
firmware
avr8_smbus_battery_monitor
Commits
2de77654
Commit
2de77654
authored
Sep 26, 2013
by
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
Changes
3
Hide whitespace changes
Inline
Side-by-side
gpio.c
View file @
2de77654
...
...
@@ -14,7 +14,7 @@ void InitGPIO(void)
// Pc3 as an input (OVP)
PORTC
=
0x
0
0
;
PORTC
=
PORTC
&
0x
F
0
;
}
void
enable_battery
(
void
)
...
...
i2c.c
View file @
2de77654
...
...
@@ -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
...
...
tibi_dabo_battery.c
View file @
2de77654
...
...
@@ -41,6 +41,7 @@ int main (void)
// initialize the GPIO
InitGPIO
();
// initialize uart
uartInit
();
// set desired baud rate in bps
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment