CPU – How to Program the CPU When Making a Small Microcomputer

assemblycircuit-designcpuschematics

I'm trying to make a small microcomputer from individual parts, but I'm having a hard time understanding how to load code onto the processor to be able to run it and do something.

Attached is my schematic so far (Schematic X1 Project), it is very messy and maybe not well designed as I am new to this. Since it is so messy, the rundown is that the CPU external memory and data pins are connected to the two RAM chips, there is one IO pin from the CPU connected to an LED.

enter image description here

My goal is to learn how to run machine code to make this LED power on. Other than those pins, I have some chip select pins for the RAM and then I have all the power pins hooked up with the correct voltages. I really do not understand how I am supposed to get machine code onto my CPU and make it run it, can anyone help?

If it helps, here is the CPU datasheet (LPC2212_2214) and the RAM datasheet (CY7C1299BN).

If anyone can help, that would be amazing.

Best Answer

You use an in-circuit serial programmer (ICSP), debugger, or JTAG that sits between your computer's USB port and your board. You lay out the board so the programmer connects to the board and microcontroller based on the microcontroller manual. You posted the datasheet. It's far too small to tell you everything about the processor. There's a much larger 1000+ page manual someone where for it. Getting the programming wiring correct makes or break your board. There are few workarounds here if something goes wrong.

EDIT: Courtesy of @bracco23: https://www.nxp.com/docs/en/user-guide/UM10114.pdf

That said, you've skipped a bunch of important steps:

You generally pick the JTAG or ICSP, IDE, and compiler BEFORE or at the same time that you choose your processor. This tends to make or break what processor you can use. In some cases, the available programmer, IDE, and compiler for the microcontroller you choose are unaffordable.

You also pick the processor AFTER seeing the manual so you know if the documentation is actually well written enough that you actually want to work with it, to get a handle on whether your skills are developed enough to be able to use the processor, and to see if the peripherals work the way you want them to work. But from your post it looks like you have never seen the manual.

At this point there is an extremely high chance this project will fail. You chose the processor and began laying out the board without first examining the manual, or considering the programmer or IDE. On top of that you skipped straight to use using external RAM.

Use netnames, not an unverifiable mess of point-to-point wires in your schematic.