Project Plans:
Project name is Gravity Jumper
Learn about the accelerometer
How to program with it in the FPGA
Sense a sudden movement
May need a filter to reduce noise
Make an image that jumps from sudden movement
Make an obstacle to jump over
For future research:
PID control
How to program the Nexys A7-100T to use the accelerometer.
Look at other Student's works
How does a sensor that "samples the full bandwidth of the sensor at all data rates" (i.e., undersampling) reduce power?
Page 28 of the Nexys A7 Reference Manual describes they describe the accelerometer
How to make sprites
[2021-05-10]
Updated the project documentation to include our final project report. Plan on adding the final report to github.
[2021-04-22]
We got a demo for the Nexus A7 to work! It uses the accelerometer, temperature, 7 segment display, rgb lights, and an audio recorder. It displays all this information using a VGA monitor.
To run the demo go to this link.
https://github.com/Digilent/Nexys-4-DDR-OOB
Ignore the github files and scroll down to the "Demo Setup" section. Follow the "Releases Page" link and click "Nexys-4-DDR-OOB-2018.2-1.zip" to download it. Once downloaded, open the directory and in the "vivado_proj" file and double click "Nexys-4-DDR-OOB.xpr". It is okay that it is an old version and let it auto update. The project is already complied, so you just need to connect you FPGA, turn it on, auto connect and program as usual. That should be it!
This link describes the demo a bit more.
https://reference.digilentinc.com/learn/programmable-logic/tutorials/nexys-4-ddr-user-demo/start
[2021-04-15]
We learned that on the class GitHub there is the master constraint file which we used to implement the accelerometer. We also updated out project file for the new research we did.
[2021-04-09]
We started researching the Accelerometer and its allot.
https://docs.google.com/document/d/1-hIhSacLoJ2XdVfxsQG0MPYAcTz51dc4dCbIhDpt5fA/edit?usp=sharing
[2021-04-08]
I forgot to upload Lab_6 to the drive so I just did.
[2021-04-06]
We've been working on Lab 6 and decided to try some extra stuff.
Changes
Initial Bat width 100
Initial Speed modifiers +- 2
Bat size decreases by 2 every hit
Ball size increases by 1 every hit
Increase speed every hit
When playing I realize that I forgot to reset the ball size so the ball just keeps growing between games, but it's funny so I'll just leave it like that. I got a high score of 26 points! but keep in mind that the counter resets after 15 to 0.
bat_n_ball_1.vhd
The Line, "hitcount <= CONV_STD_LOGIC_VECTOR(0, 16);" sets the score counter to count from 0 to 16 which is why if you get past "F" in the hex counter you got to zero.
"stop_dbl_hit" is to prevent the ball from double bouncing in the paddle. The ball cannot hit the paddle again until it hits the ceiling.
Pressing the center button or "btn0" will set "serve" to 1 which initiates the start of the game at this line "IF serve = '1' AND game_on = '0' THEN".
There is only one ball the entire game. When the ball reaches the bottom of the screen "game_on" is set to zero, this cause this line to run: "ball_y <= CONV_STD_LOGIC_VECTOR(440, 11);". This effective just moves the ball of screen making it "disappear" then when the game starts again it is just moved back.
The ball's "random" spawning is actually not random at all. If you start the game right when the ball disappears it always spawns right on top of where it disappeared. What's happening is the ball is moved off screen (probably below the screen but within the sides of the screen) so the ball continues moving around invisibly. So if you wait a bit after the game ends to spawn the ball, you will see that it will spawn ahead of where it was going, but always start move in the top right direction.
[2021-04-01]
I giving the project the name of Gravity Jumper and added a Project Plans above. I recently learned of something called PID Control which I desire to learn. I learned on it from this video:
[2021-03-19]
Finished Lab 5. When we first programmed the device after the modifications it didn't seem to make a sound but after fiddling with the 8 bottom switches (R13 - J15) and the Top button (BTNU) the FPGA stated to produce a sound. Found that the bottom switches from R13 - J15 control the speed of the wave. The Top button turns the signal into a square wave which sounds louder and possible more crisp.
Discoveries:
siren_1.vhd
In the siren_1.vhd file I bet one could change "wail_speed(0) <= SW0;" to ""wail_speed(10) <= SW0;" and see how switch J15 will now produce the fastest wave.
siren_1.xdc
We realized that "PACKAGE_PIN M18" in the siren_1.xdc file refers to the BTNU button which on the FPGA is also labeled "M18". And "get_ports { BTN0 }" just refers to the name that the BTNU button has in the files. The constraint file serves to constraint pins to variables, from physical pins to language. So "PACKAGE_PIN" is the pin on the FPGA and "get_ports" is the name in the files that are linked together. Which is how you can tell that "SW5" is the T18 switch by this line in the siren_1.xdc:
"set_property -dict { PACKAGE_PIN T18 IOSTANDARD LVCMOS33 } [get_ports { SW5 }];"
Though I still don't know what the rest of the line is for.
tone_1.vhd
With the tone_1.vhd file, we found how a square and triangle wave are defined:
data_sq <= to_signed(16383,16) when "00",
data_tri <= index when "00",
Though I don't know how "to_signed(16383,16) when '00'" means a square wave.
wail_1.vhd
The variable wspeed not only sets the speed or the wave siren_1.vhd but also changes the changes the pitch in wail_1.vhd, which makes sense, as a faster frequency also means a higher pitch.
[2021-03-19]
Finished Lab 4. Plan on trying to add multiplication or at least modifying the code so subtraction is multiplication.
[2021-03-11]
We finished Lab 3. On top of the requested changes for color, size, shape, and motion, we tried to add background by creating a huge second ball that doesn't move, but we weren't able to get it to work. We turned the ball into a donut through. Found a link on how to make sprites.
[2021-03-04]
Finished Lab 2 with my partner and setup a google drive which we shared with the teacher.
Google Drive link:
https://drive.google.com/drive/folders/1NJ0mbMqLrJf4ZKakhl5KC9nikmuA6-K-?usp=sharing
The link will let anyone using a Stevens email to view the files so other students can see our work as well.
[2021-03-04]
Finished Lab 1 with my partner.
[2021-03-02]
Made some adjustments to previous reports so that they are more accurate. I found that I in the previous report I used a lot more quotations than I really needed to.
[2021-02-25]
I found this link that describes more of the accelerometer on the Nexys
It has a wake-up mode that I presume is a toggle to turn on and off the accelerometer. The accelerometer is specifically a "ADXL362," and unlike other accelerometers that use "power duty cycling to achieve low power" this accelerometer "samples the full bandwidth of the sensor at all data rates." But I didn't know what that meant so I tried searching it up.
This link describes Power Cycling
https://www.analog.com/en/analog-dialogue/articles/optimizing-energy-use-in-advanced-sensors.html#
The link describes power cycling as a way to conserve average power consumption. Upon reading a bit and doing a quick google search, power cycling is just conserving energy by turning unused things off.
I also learned that something that translates physical happenings into digital signals can be called a Transducers. What I found most interesting about Transducers is that they require filtering, signal conditioning, offset adjustment, and gain adjustment, all things that I'm learning about in other classes! In fact this picture that they used includes a "correction" function that is the same as convolution that I did for homework!
This is a new learning experience for me as I usually don't find proof of the stuff I'm learning at school. As in notice the things I learn outside of school.
This link describes power consumption from signals
https://journals.sagepub.com/doi/full/10.1177/1550147717750030
A quick search told me that high peak variable data consumes more energy, but I'm not sure if this is related to why the ADXL362 samples their whole bandwidth.
This link describes the ADXL362
https://www.analog.com/media/en/technical-documentation/data-sheets/adxl362.pdf
Apparently it's an ultralow power accelerometer. It has it's own temperature sensor and clock. A prevalent power saving feature is the "ultralow current consumption."
The pdf describes the sensor's applications and apparently they can be used in hearing aids. They can also be used as a wireless sensor so that's good.
It has 3 Serial Peripheral Interface (SPI) commands: write register, read register, and read FIFO. After reading, I found that these commands are similar to the commands I learned for ARM assembler, in that the instructions use very small bits.
The sensor operates from 1.6 V to 3.5 V.
Overall
I learned some of the specifics of the accelerometer on the Nexys A7 Rm, but I didn't really learn much on how to use it. Next time I will research how to program the Nexys A7 Rm to use the accelerometer.
Also sorry if all these links are unnecessary. I mostly wanted to add the useful links I found so I could use them in the future as reference or to learn more on the subject.
[2021-02-18] I added my Github link though I haven't put anything on it. I reviewed Chapter 6 of Free Range VHDL. It was simple enough as most of the functions are similar to what I learned for assembler code. Chapter 7 was also simple to understand as they are simple gates that I am familiar with. For a project, I am interested in making something with motion control. I was thinking of something simple like the player moves around with motion control to collect coins and avoid pits. For that I plan on learning how to use the motion control sensor.
[2021-02-09] Watched Nerdy Dave's "Getting Started With VHDL on Windows (GHDL & GTKWave)", and read Chapters 1 - 3 of Free Range VHDL. Also as VHDL is a completely new topic for me I researched it. I found this website that helped me understand more that VHDL is a low level language that can broadly describe gates. (Sorry this is late, I was unfamiliar with Google Sites and didn't know I had to republish the website)