MSP430 in an FPGASeptember 7, 2024 Introduction Texas Instruments MSP430 is one of my favorite CPU architectures, so while bored on a 2 hour airplane ride I decided to start coding it out in Verilog. The instruction opcode encoding is one of the cleanest I've seen, which made most of this pretty easy. The hardest part was all the complex addressing modes. Those weren't too bad either really. This implementation doesn't have the same peripherals as an actual MSP430 chip and it's not cycle compatible, although it probably could be with some more work. I might turn this into something bigger later. Related Projects @mikekohn.net
Source Code git clone https://github.com/mikeakohn/msp430_fpga.git Features This was basically a fork of the RISC-V FPGA project I did earlier. Other than the core itself, the bus was changed to be 16 bit and the hardware Mandelbrot was removed, but other than that the supporting files are pretty much identical. The full instruction set should be supported, although might need some better testing. A large number of instructions and addressing modes are exercised in the tests/lcd.asm which generates a Mandelbrot on an LCD display just like the RISC-V project does. The project is setup to work on an IceFUN board but I might break this out into something bigger and get it working on a different chip. The supported peripherals are IO, Button input, speaker tone generator, and SPI. The memory map has two 4k RAM segments and a 4k ROM segement at the top of the 16 bit addressable memory.
* Bank 0: 0x0000 RAM (4096 bytes)
* Bank 1: 0x4000 Peripherals
* Bank 2: 0x8000 RAM (4096 bytes)
* Bank 3: 0xf000 ROM (4096 bytes)
* 0x4000: input from push button
* 0x4002: SPI TX buffer
* 0x4004: SPI RX buffer
* 0x4006: SPI control: bit 2: 8/16, bit 1: start strobe, bit 0: busy
* 0x4010: ioport_A output (in my test case only 1 pin is connected)
* 0x4012: MIDI note value (60-96) to play a tone on the speaker or 0 to stop
* 0x4014: ioport_B output (3 pins)
The sample test code can be assembled with naken_asm.
Copyright 1997-2024 - Michael Kohn
|