Saturday 5 May 2012

Fixed atmega bootloader

Well, I didn't particularly want to learn about the intricate details of getting Atmega bootloaders up and running, but it appears it's working.

I was a bit nervous when I did the chip erase as that was a definite farewell to the stock AVR loader, but there didn't seem to be any other options. After a couple of hours with no bootloader at all, my Z80 bit-bashing code finally prevailed:

Now, I can get on to the task I actually wanted to do... write a JTAG programmer for the PROM!

Hit a hurdle with the Atmega

So, a bit of background. Whilst the "real" work of emulating the Amstrad is all on the FPGA, you might have noticed a couple of extra chips. Basically, I wanted to have a nice interface to the PC so that I can expose serial ports, reprogram the FPGA, etc. To that end, I'm using the Atmega32U2 chip which has a few IO lines and a USB port built in. Best of all, it has 32KB of flash space so you can actually do quite a lot with it.

I've soldered up most of the board apart the FPGA and the RAM because I wanted to test the board in stages, and the first stage is to get my JTAG PROM programmer up and running before hooking up the FPGA. And I hit a snag... it seems either I did something stupid while trying to flash the first time or my chip was shipped write-protected. I'm not sure how I could have done this myself as it requires deliberate effort to write protect the fuses (I think), but it seems crazy for the part to be not write enabled, so I guess I must have somehow. Annoyingly, I've used this same chip before and never had a problem.

So, I guess I'm doing this the hard way... If I need to knock together a serial programmer for the Atmega before I can get round to making the FPGA programmer run on the Atmega, I might as well keep things real by using my prototype board to do the bit-bashing (also, I don't have a handy 3.3V IO board knocking around anyway!) and so my goal of developing this entirely self-hosting is still kind of fulfilled with some Z80 code running on the previous revision of the board, uploaded using the old SREC method:

Still, I suspect I won't even have the Atmega programmed before Tunk and J turn up this evening... :(

Tuesday 1 May 2012

Boards arrived....

Yay! My boards arrived last night. They look very resplendent in their purple and gold:
I was out at football for most of last night, but I did manage to find time to sodler on all the bottom components (except for headers which I'll save until last):
and I've soldered on all the top-side components and verified that my power supply circuit gives me nice regulated supplies at 1.2V, 2.5V and 3.3V:
I'm going to solder things on piecemeal from now - I want to verify the Atmega circuitry works next, then I'll add the PROM and attempt to program it, before attaching RAM, flash and the FPGA itself. The headers will be the very last thing to go on as otherwise I'll probably melt the plastic with too much heat!