Skip to content
Snippets Groups Projects
Commit 73adcb43 authored by Leonardo Martinez Hornak's avatar Leonardo Martinez Hornak
Browse files

Setting SCL to 400kHz

parent 4e34677e
Branches
Tags test_v1
No related merge requests found
......@@ -34,10 +34,8 @@ void initializeI2C(int slave_address)
//The STOP condition is generated by the user
EUSCI_B0->CTLW1 = 0;
//TODO Increase to 400kHz
// SMCLK / BRW = 100kHz - desired baudrate (12MHz/100kHz)=120
//EUSCI_B0->BRW = 120;
EUSCI_B0->BRW = 480; // To get 25kHz
// SMCLK / BRW = 100kHz - desired baudrate (12MHz/400kHz)=30
EUSCI_B0->BRW = 30;
//Slave address
EUSCI_B0->I2CSA = slave_address;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment