Commit MetaInfo

Revision277a390f29f5231594707571e82aa6c5828abfd0 (tree)
Time2019-01-28 16:27:55
Authoringlorion <homemicro@ingl...>
Commiteringlorion

Log Message

added requirements and instructions for programming video, rom, and cartridges

Change Summary

Incremental Difference

diff -r 2ab3c233ff48 -r 277a390f29f5 docs/programming-hm1000-video.txt
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/docs/programming-hm1000-video.txt Sun Jan 27 23:27:55 2019 -0800
@@ -0,0 +1,76 @@
1+#+TITLE: Programming the HM1000 Video Controller
2+
3+The HM1000 video controller makes use of an ATmega328P or similar
4+microcontroller to generate hsync and vsync signals and video memory
5+addresses.
6+
7+The recommended microcontroller is the Microchip ATmega328P. The
8+ATmega328 (without the P) also works.
9+
10+* Building the Firmware
11+
12+To build the program that drives the video controller, from the root
13+of the repository:
14+
15+#+BEGIN_SRC sh
16+homemicro$ cd vga
17+vga$ make
18+#+END_SRC
19+
20+This will create ~vga-m328-ntsc.hex~, which can then be written to the
21+ATmega328P.
22+
23+* AVRDUDE
24+
25+If you are using the
26+[[file:design/atmega328-programmer.txt][ATmega328 programmer circuit]] with a Raspberry Pi, you can write the
27+program to the microcontroller using AVRDUDE.
28+
29+AVRDUDE requires a configuration file. For this example, we assume
30+a file named ~/.avrdude.conf with the following contents:
31+
32+#+BEGIN_SRC
33+programmer
34+ id = "m328";
35+ desc = "Use the Linux sysfs interface to bitbang GPIO lines";
36+ type = "linuxgpio";
37+ reset = 4;
38+ sck = 17;
39+ miso = 27;
40+ mosi = 22;
41+;
42+#+END_SRC
43+
44+This tells AVRDUDE to use the Raspberry Pi's GPIO pins, and tells it
45+which pins to use for which signals. The numbers correspond to the pin
46+numbers used by the
47+[[file:design/atmega328-programmer.txt][ATmega328 programmer circuit]].
48+
49+The following command writes vga-m328-ntsc.hex to the microcontroller:
50+
51+#+BEGIN_SRC sh
52+vga$ sudo avrdude -p m328p -c m328 -C +$HOME/.avrdude.conf -U flash:w:vga-m328-ntsc.hex
53+#+END_SRC
54+
55+Note the + after the -C option.
56+
57+Here, -p is used to specify the part. "m328p" is AVRDUDE's name for
58+the ATmega328P. If you have the non-P version, use "m328" here.
59+
60+The "-c m328" specifies the programmer id and should match the one in
61+your configuration file.
62+
63+The configuration file is specified with the -C option. The + here
64+means to add the configuration to what already exists, instead of
65+replacing it.
66+
67+The -U option specifies the operation to be performed. In this case,
68+we will write to the flash memory the contents of vga-m328-nstc.hex.
69+
70+After the program has been written, we also need to set the fuses on
71+the ATmega so that it uses an external clock source and does not
72+divide the clock by 8. This is accomplished by the following command:
73+
74+#+BEGIN_SRC sh
75+vga$ sudo avrdude -p m328p -c m328 -C +$HOME/.avrdude.conf -U lfuse:w:0xe0:m
76+#+END_SRC
diff -r 2ab3c233ff48 -r 277a390f29f5 docs/programming-rom.txt
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/docs/programming-rom.txt Sun Jan 27 23:27:55 2019 -0800
@@ -0,0 +1,34 @@
1+#+TITLE: Programming the ROM
2+
3+To build the Home Micro ROM, from the top of the repository:
4+
5+#+BEGIN_SRC sh
6+homemicro$ cd rom
7+rom$ make
8+#+END_SRC
9+
10+This will create ~rom.bin~.
11+
12+If you are using the [[file:design/rom-programmer.txt][ROM Programmer circuit]]
13+with a Raspberry Pi, you can use the writerom tool to write the ROM
14+image to the ROM chip.
15+
16+First, the writerom tool has to be built (this only needs to be done
17+once - and, of course, if you make changes to the writerom tool).
18+Again starting from the top of the repository (use ~cd ..~ first if
19+you are in the ROM directory):
20+
21+#+BEGIN_SRC sh
22+homemicro$ cd tools
23+tools$ make
24+#+END_SRC
25+
26+To write the ROM image using the writerom tool (from the rom directory):
27+
28+#+BEGIN_SRC sh
29+rom$ sudo ../tools/memory/writerom rom.bin 0 8192
30+#+END_SRC
31+
32+The numbers here indicate the start position and the size of the ROM
33+image, respectively.
34+
diff -r 2ab3c233ff48 -r 277a390f29f5 docs/requirements.txt
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/docs/requirements.txt Sun Jan 27 23:27:55 2019 -0800
@@ -0,0 +1,50 @@
1+#+TITLE: Requirements
2+
3+* Tools
4+
5+** Raspberry Pi
6+
7+A Raspberry Pi computer is recommended to program the various ICs that
8+require programming, such as the computer's ROM. The Raspberry Pi's
9+GPIO pins give it the flexibility to implement all the necessary
10+protocols, and at $35, even the top of the line model is quite
11+affordable and may in fact be cheaper than buying dedicated
12+programmers for the ICs that go into the Home Micro.
13+
14+A number of different models of Raspberry Pi are available. The tools
15+and circuits in the Home Micro repository require a Pi with the 40-pin
16+GPIO header (which excludes some early models). The following models
17+have been tested and are known to work:
18+
19+ - Raspberry Pi 3 Model B.
20+ - Raspberry Pi 2 Model B.
21+
22+More information about the Raspberry Pi, as well as ways to buy a
23+Raspberry Pi, can be found at https://www.raspberrypi.org/
24+
25+Use of the Raspbian operating system on the Raspberry Pi is recommended.
26+
27+** Oscilloscope
28+
29+An oscilloscope is not technically required to build the Home Micro
30+computers. It can be an invaluable tool in visualizing what goes on in
31+a circuit and to find and fix problems, but good oscilloscopes can
32+also be quite pricey. It may be worth the investment if you plan to do
33+electronics projects regularly. The signals in the Home Micro get up
34+to 14.31818MHz, so to be most useful, an oscilloscope would have to
35+work up to frequencies higher than that.
36+
37+* Software
38+
39+To build the source code in the repository, you will need the
40+following software:
41+
42+ - make :: to use the Makefiles
43+ - C compiler :: for the tools and the emulator
44+ - avr-as :: to build the AVR code
45+ - xa :: to assemble the 6502 code
46+ - xcb :: to build the emulator
47+
48+On Raspbian, you can install these by running:
49+
50+ : aptitude install binutils-avr gcc make xa65 libxcb1-dev
diff -r 2ab3c233ff48 -r 277a390f29f5 docs/writing-cartridges.txt
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/docs/writing-cartridges.txt Sun Jan 27 23:27:55 2019 -0800
@@ -0,0 +1,23 @@
1+#+TITLE: Writing Cartridges
2+
3+Writing to cartridges can be done using the
4+[[file:design/cartridge-programmer.txt][cartridge programmer circuit]] and a Raspberry Pi.
5+
6+First, build the writecart tool:
7+
8+#+BEGIN_SRC sh
9+homemicro$ cd tools
10+tools$ make
11+#+END_SRC
12+
13+Then, use ~sudo path/to/writecart image_to_write~ to write an image to
14+the cartridge.
15+
16+For example, to build the testkeys app and write it to a cartridge,
17+you could use:
18+
19+#+BEGIN_SRC sh
20+homemicro$ cd apps/testkeys
21+testkeys$ make
22+testkeys$ sudo ../../tools/cartridge/writecart testkeys.bin
23+#+END_SRC
Show on old repository browser