SPI on FPGA 3-Axis Accelerometer Nexys A7 or Basys 3 w/ PmodACL2 Verilog

Поделиться
HTML-код
  • Опубликовано: 17 окт 2024

Комментарии • 24

  • @chasenoorda9931
    @chasenoorda9931 7 дней назад +1

    Great video

  • @hamzainam6211
    @hamzainam6211 11 месяцев назад +1

    Excellent work form your Side.

  • @michaelalex5235
    @michaelalex5235 Год назад +4

    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!

    • @dajoma36
      @dajoma36  Год назад +1

      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.

    • @fmm5322
      @fmm5322 11 месяцев назад

      @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

    • @fmm5322
      @fmm5322 11 месяцев назад

      Any replies

  • @chasenoorda9931
    @chasenoorda9931 7 дней назад +1

    The z direction could be always in the positive direction because it’s always sensing gravity.

  • @fmm5322
    @fmm5322 11 месяцев назад

    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

    • @dajoma36
      @dajoma36  11 месяцев назад

      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.

    • @fmm5322
      @fmm5322 11 месяцев назад

      @@dajoma36 ok no problem. How can we check the code without real sensor? Any emulated idea.? How to generate miso data without sensor.

    • @dajoma36
      @dajoma36  11 месяцев назад

      @@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.

  • @NerdTheNinja
    @NerdTheNinja Год назад

    Could you explain why you used the 4MHz frequency for the SPI master clock?

    • @dajoma36
      @dajoma36  Год назад +1

      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.

    • @NerdTheNinja
      @NerdTheNinja Год назад +1

      @@dajoma36 thanks, love your videos.

    • @dajoma36
      @dajoma36  Год назад +1

      @@NerdTheNinja Thanks! I'm planning a series of videos on CPUs.

  • @aviadsrur2919
    @aviadsrur2919 2 года назад +1

    Hey, thank you for your videos.
    Can you make project videos about cpu and Bluetooth communication (with hc-06) ?

    • @dajoma36
      @dajoma36  2 года назад +1

      Maybe in the future, I will get to those subjects.

  • @thanatosor
    @thanatosor 3 месяца назад

    Why don't we use AXI-Lite ?

    • @dajoma36
      @dajoma36  3 месяца назад +1

      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
      @thanatosor 3 месяца назад

      @@dajoma36 so If I want to use it on Artix-7, I need a soft-core CPU like microBlaze right ?

    • @dajoma36
      @dajoma36  3 месяца назад

      @@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.

  • @fmm5322
    @fmm5322 Год назад

    Code downloadable link?

    • @dajoma36
      @dajoma36  Год назад

      In the video description is a link to a Github site that has the code.