Skip to content
Snippets Groups Projects
Commit a6627709 authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

MSP430 I2C: Configurable I2C frequency

parent 69c6db98
No related branches found
No related tags found
No related merge requests found
......@@ -8,7 +8,7 @@ signed char I2C::setup()
{
UCB0CTL1 = UCSWRST;
UCB0CTLW0 = UCMODE_3 | UCMST | UCSYNC | UCSSEL_2 | UCSWRST | UCCLTO_1;
UCB0BRW = 0xf00;
UCB0BRW = (F_CPU / F_I2C) - 1;
P1DIR &= ~(BIT6 | BIT7);
P1SEL0 &= ~(BIT6 | BIT7);
P1SEL1 |= BIT6 | BIT7;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment