Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

CCS MSP430 I2c scanner code

Status
Not open for further replies.

ajit_nayak87

Member level 5
Member level 5
Joined
Oct 30, 2017
Messages
86
Helped
1
Reputation
2
Reaction score
1
Trophy points
8
Activity points
981
I am looking for sample I2c scanner code using code composer studio. I am using MSP430 series launchpad.

I wanted to scan I2c Device connected SDA and SCL line. iS there any sample code available like Arduino I2c Scanner c code.
 

Hi,

If I´m not mistaken you are looking for a:

FOR 8 to 119 WHILE LOOP
and within the loop you just send the address byte and see if the ACK is set

Klaus
 

Hello!

As a former user of MSP430, I can tell you that the code you want almost certainly already exists
in source code, examples provided by TI. I have restarted recently just for fun, with MSP430FR5994
(FRAM based).

All their source code are named "slacxxx.zip". And there is one slac file per MSP family.
In the past it used to contain .asm and the equivalent .c file. But the slac I downloaded recently
contains only C files.

And the good thing about their examples is that they all fit in 1 page. This means that it just
focuses on 1 item. For example (1 exampe per file)
adc01.c : how to read a single sample, one shot
adc02.c : single sequence of n values
adc03.c: single sample repeated
adc03.c: sequence repeated ...
etc, etc..
It's a lot easier to understand than a full program mixing many features. So in the i2cxx.c,
you will probably find the exact configuration you are looking for.

Beside this, MSP430 has a built-in I2C engine, so you don't even have to bother bit banging
it, you configure the I2C engine and you can write your own read and write functions.
That's pretty straightforward.
What MSP are you using?

Dora
 
Last edited:

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top