This is good stuff! I may have missed it, but it doesn't look like the accelerometer data is being scaled. The raw acceleration data is in ADC counts. So if the data resolution is 12 bits over a full scale range of +/- 2g, then to convert the raw measurement to units of g, one would use the formula: (2*raw_data_in_counts)/(2048). Even if the board isn't perfectly flat, two of the axes should still read reasonably close to 0g while the Z-axis will be close to + or - 1g. Again, maybe I missed the conversion of counts to units of g in your code; if so, please ignore my comments. Thanks again!
Hello. Thanks for the comment. I did this project to simply read the raw data coming from the accelerometer using SPI communication, and then I chopped the data so it could be represented on the 7-segment displays to verify the reading of the data. It was an exercise in learning SPI circuitry and demonstrating on an FPGA. I did not consider converting the data to make it more usable and accurate. Adding the circuitry to convert the data would be a great way to extend this project into something more meaningful. Thanks for the great idea and the information on using the data from the accelerometer.
@michealalex5235 can u explain one simple thing. Suppose i am calling spi master module from a top module that contains the spi read and write comands to spi module Sent the write comands for configuration. Simple In read from miso line of sensor, i have to send register addrsss 0xE then have to read register. Do i have to wait here for burst read so that addrdss points to register 0xF
I watch your videos regularly. I have a simple question. Suppose sensor supports 5MHz spi interface. That mean sclk is @5MHz. If we set output data rate of sensor @100 HZ how we make sure that we are logging the correct output samples during spi read from sensor? Because we are sampling @poseedge of sclk
@@fmm5322 You should be able to test the circuit without a real sensor using a test bench module. To generate the sensor data, you would need to find out how the data is formatted, and then use that data format in the test bench script to stimulate the circuit, along with the other inputs for the circuit, such as clock, reset, etc.
I believe the AXI is only for use with Xilinx Zynq chips, which are SOCs (System on a Chip) that include FPGA fabric as well as processor fabric. AXI is used for the processor part.
@@thanatosor That's a good question. Sorry, but I don't have any experience with microBlaze and using AXI at all. I only know about it that it is used with the Zynq SOCs.
Great video
Excellent work form your Side.
This is good stuff! I may have missed it, but it doesn't look like the accelerometer data is being scaled. The raw acceleration data is in ADC counts. So if the data resolution is 12 bits over a full scale range of +/- 2g, then to convert the raw measurement to units of g, one would use the formula: (2*raw_data_in_counts)/(2048). Even if the board isn't perfectly flat, two of the axes should still read reasonably close to 0g while the Z-axis will be close to + or - 1g. Again, maybe I missed the conversion of counts to units of g in your code; if so, please ignore my comments. Thanks again!
Hello. Thanks for the comment. I did this project to simply read the raw data coming from the accelerometer using SPI communication, and then I chopped the data so it could be represented on the 7-segment displays to verify the reading of the data. It was an exercise in learning SPI circuitry and demonstrating on an FPGA. I did not consider converting the data to make it more usable and accurate. Adding the circuitry to convert the data would be a great way to extend this project into something more meaningful. Thanks for the great idea and the information on using the data from the accelerometer.
@michealalex5235 can u explain one simple thing. Suppose i am calling spi master module from a top module that contains the spi read and write comands to spi module
Sent the write comands for configuration. Simple
In read from miso line of sensor, i have to send register addrsss 0xE then have to read register. Do i have to wait here for burst read so that addrdss points to register 0xF
Any replies
The z direction could be always in the positive direction because it’s always sensing gravity.
Great point!
I watch your videos regularly. I have a simple question. Suppose sensor supports 5MHz spi interface. That mean sclk is @5MHz. If we set output data rate of sensor @100 HZ how we make sure that we are logging the correct output samples during spi read from sensor? Because we are sampling @poseedge of sclk
Sorry, but I'm not really sure you mean and what you are asking. To be honest, I haven't done anything with SPI except for that video.
@@dajoma36 ok no problem. How can we check the code without real sensor? Any emulated idea.? How to generate miso data without sensor.
@@fmm5322 You should be able to test the circuit without a real sensor using a test bench module. To generate the sensor data, you would need to find out how the data is formatted, and then use that data format in the test bench script to stimulate the circuit, along with the other inputs for the circuit, such as clock, reset, etc.
Could you explain why you used the 4MHz frequency for the SPI master clock?
I think I did so because the datasheet for the accelerometer recommends an SCLK speed of 1MHz to 8MHz, and I just picked a spot in the middle of that.
@@dajoma36 thanks, love your videos.
@@NerdTheNinja Thanks! I'm planning a series of videos on CPUs.
Hey, thank you for your videos.
Can you make project videos about cpu and Bluetooth communication (with hc-06) ?
Maybe in the future, I will get to those subjects.
Why don't we use AXI-Lite ?
I believe the AXI is only for use with Xilinx Zynq chips, which are SOCs (System on a Chip) that include FPGA fabric as well as processor fabric. AXI is used for the processor part.
@@dajoma36 so If I want to use it on Artix-7, I need a soft-core CPU like microBlaze right ?
@@thanatosor That's a good question. Sorry, but I don't have any experience with microBlaze and using AXI at all. I only know about it that it is used with the Zynq SOCs.
Code downloadable link?
In the video description is a link to a Github site that has the code.