Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

doubt in using c compiler?????

Status
Not open for further replies.

n_vikranth

New Member
I planned to interface ADXL345 with ATmega16A using SPI bus... iam using mikro c pro compiler and I have one doubt in compiler that to write and read from ADXL345 I used predefined library from compiler.
But to write data and address towards adxl345 we have only same command that
SPI1_Write(data); how to write data and address…
If u know kindly tell me how to send address and data towards ADXL345 using 3-wire SPI bus
And using the library files from mikro c pro compiler….
 
I dont know the lib you want to use. But the read and write command is possibly enough.
Switch CE down and send the Address including steering bits. Then send the according values you want to send.
After that you have to switch the CE to up.
Reading should work the same way. It could be, that you have to write a command into the Chip, before reading out the Data with the read command, without switching up the CE signal.
But without knowledge of the include file I couldn't be shure.
Some read values are 16Bit. In this case i guess you have to read out 2 Bytes.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top