Forum Discussion
Altera_Forum
Honored Contributor
12 years ago --- Quote Start --- Hello, Recently I started a project in wich I have to get the datas from the 3 axis of the accelerometer ADXL345 of the DE0-nano board. I only have some skills in VHDL but i can understand verilog. So I started from the project DE0_Nano_Gsensor that is in the CD included with the board. This project only give the datas in the X-axis, and i tried to analyze the code (spi_controller.v, spi_ee_config.v) in order to change it to add the 2 other axis, but i really don't understand them. The fact is that i don't understand the communication between the ADXL and the Verilog program. So my question is, what do i have to change in the original program to get the 3 axis datas, or if you have some advices to help me to start a VHDL/verilog program in order to get the 3 axis datas with SPI communication, cause i am kinda stuck :(. --- Quote End --- I'm actually not comfort with Verilog. I just made a code that can access the ADXL345, I know because a I read the first register and it gave me the right code, but I’m still having some problems with the axis reading, they oscillate a lot =/. But about your problem. I don't know if you code does it, but before the SPI-3 (SPI-4 on DE0-nano is impossible) you must change a register value, because the default communication SPI is 4, as you don't have 4 pins, you must communicate through I2C, reconfigure the register, so the SPI-4 become SPI-3.