More JuiceBox Dev
I’m not entirely new to microcontrollers, although I’ve never been around the ARM ones. Most of my experience comes from the Atmel AVR line of microcontrollers, but I still consider myself a noob.
The JuiceBox is a great dev board to learn on. Everything is production prewired, all you have to do is write the code to work it…
Today I have made some significant progress with the general understanding of this embedded hardware. Using just JTAG/OCDCommander, the datasheet, and the register definitions in s3c44b0x.h, I have gotten two different parts of the board to work. First, the buttons. This was pretty easy, since I have worked with the idea of setting the direction of a port and manipulating the port in the past.
The buttons of the juicebox are located on port G, so two primary registers are involved: PCONG and PDATG. The first one being the direction of the port (16-bit register, 2 bits per pin to be: input, output, special), and the second one being the data representing that port (8-bit). Instead of fumbling with the math and finding the bitwise masks required to push certain buttons, I simply read the PDATG back in OCDCommander with different buttons pressed at different times, and then defined these values in my own code to be easily accessible and easily compared to PDATG. I get this in the end:
#define JB_PLAY 0×9D
#define JB_RETURN 0×9E
#define JB_STAR 0×8F
#define JB_FORWARD 0×9B
#define JB_REVERSE 0×97
#define JB_ATREST 0×9F
To use the port G, I first set the direction of the whole port to input (pcong = 0×0000;), and then the data on port G can be directly compared to these constants. It works great.
Since this worked out of the box so well, I decided to write my own UART interface. I am familiar with UART in general (used it a lot in the AVRs), so I have a basic understanding of how it works. The init() and putc() of my UART interface also surprisingly worked out of the box, but the getc() still needs a bit of work (it half works). When I’m done, I’ll post the UART interface code.
JB Button Test Source Code (prints out in the LCD what button you have pressed), precompiled elf included as well:
http://www.frozeneskimo.com/electronics/wp-content/uploads/Software/JBButtons.zip
Note: I take absolutely no responsibility for any damage this software may cause.