Quantcast
Channel: MSP430 Technical Forums
Viewing all articles
Browse latest Browse all 2077

Getting I2C(1), i.e. USCI_B1, to work on F5529 Launchpad

$
0
0

Hi

 

I want to be able to use the second I2C module on my F5529 Launchpad. My project works fine with the default module 0, USCI_B0, using Energia.

But I want to also use the CC3000 Wifi module, and that seems to be using the USCI_B0 for SPI.

 

Therefore I think the simplest thing would be to enable support for the USCI_B1 in Energia.

I've spent some time now, and have done all the code changes needed, as far as I can see.

 

I've pushed my code to https://github.com/alfh/Energia/tree/feature_i2c_uscb1, the changes are here : https://github.com/alfh/Energia/compare/feature_i2c_uscb1?expand=1

 

 

What I've really done, is to change twi.c, so instead of using UCB0* registers and controls, it uses UCBx*, where the UCBx* are set to point to either UCB0 or UCB1, based on the "USE_USCI_B1".

 

 

The code is working fine if I don't define USE_USCI_B1, because then it sticks to using USCI_B0.

So the code in twi.c is working fine when using USBx* defined as USB0*.

 

But when I try to use USB1*, my test hangs on "Wire.endTransmission".

I'm using the same launchpad, just moving wires from P3.1 to P4.2, and P3.0 to P4.1.

 

I do not have a logic analyzer or other tools to check what is actually being sent on the wires.

 

Does anyone have a clue as to what I might have forgotten to change, or where I've made a mistake ?

 

I've also edited the twi.c, pins_energia.h and usci_isr_handler.c (not committed to github), removing the UCB0 stuff and only having UCB1 stuff, since I am unsure if the "#ifndef USE_USCI_B1" is working everywhere, it seems like it is not working properly in usci_isr_handler.c. 

I've also hacked and removed all the code related to "__MSP430_HAS_USCI__", "__MSP430_HAS_EUSCI_A0__", and "__MSP430_HAS_USI__", it then still works for USCI_B0.

But I still do not get the USCB1 to work.

 

I've not been able to find anything in the documentation that points to differences between USCI_B0 and USCI_B1, expect for different registers etc.

So I hope someone can help me get further.

 

Regards

Alf Høgemark

 


Viewing all articles
Browse latest Browse all 2077

Trending Articles