I decided to go through the workshop tutorial from 2019 Supercon for this badge. I was running into a few things that I didn’t understand so I searched the web and then bought a book. Not knowing the proper jargon made it difficult to search for some things. Such as:
reg [7:0] membyte {0:1024]
reg [8*18:1] string_value
Not knowing how to look those up was difficult. The book I ordered had those examples with explanations in chapter 3. At least I was getting somewhere.
I was running into some issues with not getting the desired result on the screen when I was editing the C code for the basic part of the workshop. The file is from https://github.com/esden/hadbadge2019_workshops/tree/master/basic/app-basic-workshop .
I kept plugging away at it for a couple of days. One of the difficult things is that the fire palette was not displaying properly with the alpha channel, and when something was assigned to GFXPAL[17] the background color of the screen would change. However, when you pressed the B button to exit the program the set background color would show up as the program was exiting.
I decided to move the definitions of the Alpha channel to further down the list, 224-256, and see what happens. The transparent colors showed up just fine. It seems that the set up should not happen so low in memory.
Another thing that was intriguing me is that there are some printf commands with text to be sent out. I had to read some other files to find out that these would be sent out to a terminal program such as CoolTerm so you can read what is sent out.
// The printf output is sent to the physical UART available on the JTAG
// programming connector. You can connect a USB to Serial adapter to
// see this console output.
I got out the USB to Serial adapter I have in a drawer and decided to try to hook it up. First I had to look at the KiCad file to see what the JTAG pins were set to.
It looks like I’d need pins 1, 2, 9, and 10. I decided that since I had batteries I would not need to use pin 1, voltage. I hooked up the black wire on the USB to Serial adapter to pin 2, ground. White (RX) to pin 10 (RX) and Green (TX) to pin 9 (TX). CoolTerm detected the adapter and I added a few printf lines to my program I was testing with. Nothing showed on CoolTerm. I changed the port speed from 9600 to something higher. Still nothing. Then I swapped the white and green wires, RX to TX and TX to RX. I got garbage on the screen at 9600 bd. I moved it up to 115200 and got readable text when I ran the program.
That was a very productive time spent while waiting for a return call from the doctor’s office.