I was hoping that going back to school would free up some time to continue working on projects and add to the site, however that has not been the case. Things have gotten actually gotten more hectic. I’ve got my normal school workload with senior design thrown on top. Speaking of which, my senior design project is creating an entry to AUVSI’s Student Unmanned Ariel Systems competition (SUAS). I am a part of the communications team which is working to create multiple communication channels between the base station and aircraft so that it is capable of flying autonomously and reporting back image data. The details of this project will be updated on a sub-domain linked below.
Since I haven’t had time to fully invest into new projects I’m going to start posting some details about a previous project of mine; a Gameboy emulator. This is an software emulator of the Gameboy system written in java for the android platform. This was the precursor to the FPGA NES that I hope to start working on again sometime soon. For now though, the Gameboy emulator (which I’m tentatively calling GameDroid) is in a fairly stable, fully working state. It has been able to play most games I’ve thrown at it with full controls, save functionality, and sound. There are some performance and timing issues that need to be fixed and I’m intending to rewrite most of the engine to work those out.
I’ve found it difficult to find a 100% complete picture of the SD Card SPI protocool. However, this is what I’ve pieced together and has managed to allow me to communicate with a Sandisk card I had sitting around. Overall progress has been slow as I’ve been occupied with other important things. I have however managed to squash the bug that turned my data line into an oscillator and have successfully read the contents of the OCR register. So, although it’s been slow there has been progress and I expect to be able to pick up the pace again now that things have settled and I’m transitioning back into school.
Over the past week I’ve been working on communicating with an SD Card using my custom SPI Controller. I’ve uncovered some bugs in the controller and begun having some success in communicating with the SD Card. A combination of unique SD Card behavior and a clock phasing bug meant I spent far too long debugging an unresponsive SD Card in the beginning stages of experimentation. Unlike a lot of the signal captures I’ve found online the SD Card I’m working with does not drive the DAT0 line high until it receives a valid CMD0 packet. My protocol analyzer was indicating that the packet I was sending out was a valid CMD0 yet nothing I did received any response from the SD Card. After lengthy debugging I looked closer at the serial data bus and found that my clock phasing was actually inverted. With the clock phasing fixed the SD Card now Drives high and responds with the expected idle response (0x01).
Aside from the bug fixes I’ve added the ability to trigger a single byte transfer from the SPI controller. This makes it much easier to prepare a data byte and send it out by removing the necessity to determine when the controller is going to poll the input bus. It’s still a bit cumbersome as I was unable to get my intended design to synthesize. I haven’t yet gotten a complete grasp on the details of the VHDL to hardware process which leads to some hiccups, but the code I have now is enough to establish communication. My current work is on another bug which is likely in the SPI Controller portion of my circuit. After receiving a card ready response (0x00) the MISO line turns into a 12kHz clock and the SD card loses synchronization.
The Serial Peripheral Interface (SPI) Bus is a full duplex synchronous serial communication standard. SPI is common in embedded applications due to it’s high throughput and relatively simple interface. This is a simple SPI controller implementation with an 8 bit word length and a single slave select line. Continue reading “FPGA: SPI Controller”
A video engineer, or really anybody who cares, would tell you that I’ve created a pretty inaccurate representation of the SMPTE color bar test pattern. As I’m not actually trying to calibrate any monitors I don’t fall into this category. I’ve modeled my test screen off of the Wikipedia description of SMPTE color bars. This project only generates a color simulation, ignoring the I and Q vectors, pluge pulse, and other underlying embedded signals. I’m satisfied with the results of this project and consider the original goal to be accomplished. Modifications to the code will most likely be required when it is integrated into the final NES project, but that is much farther down the road. The updated color generator code as well as a download link to the entire project are provided below. Continue reading “FPGA NES: VGA (Part 3)”