Thursday, April 30, 2009

sparkfun prototype demo

It works (kind of)!

My prototype board that plugs into the sparkfun fpga breakout seems to be working to some degree. I can play super mario world, but other games won't boot, even ones that otherwise work in my de2 prototype (same sd card and everything).

I have some debugging to do...

Saturday, April 25, 2009

Decoupling

So I've bascially been in my lab non-stop since the last post, trying to figure out why I can't read from the SD card. I tried everything.. adding pull-ups, changing drive currents, putting a decoupling cap across the sd card supply... nothing works, all the signals going into it seem ok. I'm clueless.

The solution? use a BIGGER decoupling cap (1uF vs .1uF). This fixed everything. I seriously want to rip my hair out... in a good way.. i think...

Thursday, April 23, 2009

New Disaster

So, I got my new plug-in boards, and I soldered on the SD card slot, plugged it into my sparkfun fpga board, and... didn't work GRRRR. I'm still not sure what's wrong, the same exact code works fine on my de2 board if i wire it up to my plug-in board.

I have a header that breaks out all the sd card pins and on the logic analyzer everything looks fine, except the SD card never puts any responses out on the DAT0 line. My first guess would be something going on with the power supply, which was suspiciously at 3.2v (should be 3.3), but I kind of wrote it off as well within the tolerances. eventually I thought it might be a good idea to maybe bypass the sparkfun power supplies and power the io directly from my bench supply.

This turned out to be a bad idea, as now the FPGA is thoroughly fried. Maybe there was something wrong with it from the get-go? I'm not sure. I put in an order to overnight me a new one to recieve on Friday. I am not feeling very hopeful though... I'm not really sure how to debug the problem further. I'll probably ping some of the lab techs for ideas.

Wednesday, April 15, 2009

One step at a time...

So I got the sparkfun spartan3e breakout board and parport programmer today. My custom board should arrive tomorrow (it plugs into the breakout board). In the meantime I've been sanding down the female headers so they all fit on the board. The idea is then I can plug stuff into the breakout board and easily detach them so I can reuse the breakout board for other projects later.

I soldered in one side of the header and did a little scrolling led test which you can see below:

I guess you can't really tell from the picture, but each led lights one at a time, scrolling across. I thought it was kind of interesting that sparkfun fails to mention in the product page that this board actually comes with an oscillator (I think 50MHz?). Very handy! It's in their schematic but it's not clearly labeled as an oscillator, just an inconspicuous random box with an enable signal and an "output" signal. Also they supply some fpga code to help flash the on-board PROM but it's targetted at a different fpga (not the one they put on the board). After I finish sanding/soldering the headers, I might post on the forum and ask about that.

In reality you shouldn't even need that stuff, since the Xilinx iMPACT software should be able to flash the PROM over jtag. I'll have to remember to test that soon.

EDIT: I was able to erase/blankcheck the prom over jtag, so I think it works. For instructions, see: xapp974.pdf

Saturday, April 11, 2009

I have the world's worst sleep schedule.

So, I finished assembling the board, and apparently all the crucial parts are working, EXCEPT for the parts that talk to the SNES (Grr....)

I have the same code running on my de2 test prototype and it works fine, but on my board, it reads a rom from the sd card (reads it back to verify), then waits for the snes to talk to it... but the SNES just shows a black screen :(
Lockout chip appears to be functioning, since the snes comes out of reset (my tv screen stays blue if there's no lockout chip).

As a test, I wrote some code to directly output to the snes pins and it appears that some of the IO on the fpga is just straight up not working. In my test, I saw that the DATA_0 io line was always grounded (actual output from fpga, not a solder bridge). This is consistent with the behavior I observed when the SRAM wasn't working properly, too. Also, randomly, the FPGA will just start chewing up current as if there's a short in the IO supply. I am very suspicious of the buffer chips, perhaps feeding back into the FPGA outputs, but it sometimes happens before I even configure the fpga (which means all the fpga output pins should be in hi-z). VERY SNEAKY. My conclusion is that this fpga is just toasted, and I have been trying to somehow bring up another board.

I was able to successfully solder at least one fpga by hand and it appears to be working with an led test, but the board is a little shady since I had used it in an experiment with a griddle. I am hoping it might work, but I guess I'll have to see how it goes tomorrow. when I populate it with a memory chip and the buffers. To be honest, I am not very hopeful.

Perhaps it wasn't the best idea to combine my first pcb design with my first time soldering fine-pitch surface mount components. I have learned a lot over the course of this project, and I think my next plan of action (assuming this board doesn't end up working) is to redesign the whole board and try again.

In the intermediary time, I think I am going to design another board with sram and an sd card slot to plug-in to the sparkfun xilinx fpga breakout board. This way I can avoid soldering a new fpga, and avoid spending extra for thin pcbs (to fit inside the snes). Also, if I can get that to work, then I should be able to just migrate the design to a new pcb 1:1. Since I'll know if the design originally worked, it will take a lot of the guesswork out of "well, maybe this line needs a pullup resistor..." and save much mangling of my pcbs.

hmm.. back to the lab again in the morning...

Saturday, April 4, 2009

Board Bringup

Well, I have made some progress. I have at least one board with an fpga that i can program from my PC.
You can sort of see in the picture that 3 of the 4 leds are illuminated. I wrote a small core for the FPGA to test the two SRAMs that I soldered on. The top one is passing (led #3), but the bottom one is isn't (led #2). led #1 tells me that the test did start and led #4 signals that the test finished. It's just a sanity check (does two writes and checks the first one), I need to do a real integrity check soon.

Not sure what's wrong, yet. I'm hoping It's something simple, like I fried the sram chip, then I can just slice it off and solder up a new one. I guess it's not that big of a deal anyway, I should at least be able to test it with just the 2mbyte of sram. That's more than I had on the de2 at least. Plus I can still solder one more for another 2mbyte.

jeeze it's late. gonna head to bed and head back to my lab in the morning.