Display Jbox

From eLinux.org
Jump to: navigation, search


These are the routines that turn the juice box in to a cheap serial graphics display. Warning: Steep leaning curve ahead. You need to understand Perl bit manipulation to use the driver program.

The basic idea is that a program running on the juicebox looks at the serial port waiting for graphics commands. Most of these graphics commands are related to bitmap manipulations. The driver programs running on the pc are written in perl but any language that can spit ascii characters at the serial port can be used. The driver programs are specific to my machines so you will need to change the total memory variables to match your particular machine. I used ForkBoy's interrupt serial routines on the juicebox. You will noticed that I had to use delay loops in the unix(aka Linux) routines to avoid character over-runs(this appears to be a problem with the perl module). The Microsloth versions didn't require delay loops. I have only tested these routines on linux and windows2000. I am sure that there are bugs hiding in this code. Please do not let your driver programs tell the juicebox to do things like put 9 bars when you only defined 8 bars, it will lead to unexpected display artifacts. I wrote these routines many months ago and their inner workings are now only a distant memory. Perhaps someone can at least use the graphics routines since these are the first 12 bit juicebox routines ever distributed.

unix_driver.pl is an example  perl unix driver program.

winms_driver.pl is an example  perl windows driver program.

display.c is the c program on the juicebox. 

Look at this program for documentation. planet571.jbp and stonehenge.jbp are sample backgrounds but any valid *.jbp can be used as a background. The example driver displays a realtime cpu usage and memory usage on a scrolling grid as well as bargraphs. I alpha blended widgets so the graphics are partially transparent. I have written all of the 12 bit color routines so you have full access to the 4096 colors(I needed them for the alpha blending).

Do the usual

 make -f display.mak 

(change "makefile" to match your tool-chain) then load it onto the juice box.

example from openocd:

load_binary /home/steve/juice_box/display/comm_1.bin 0x0c001000

resume 0x0c001000

or if you are one of the few with a fatjbox just put display.bin on your sd card and run.

Then from another terminal window run the perl driver program (note the two nonstandard modules Device::SerialPort 0.12 and Time::HiRes)


./unix_driver.pl  planet571.jbp

The perl driver program supplies the data over the serial port of the pc to the juicebox. I am assuming that you have a serial port attached to the juice box.

You can define bitmaps on the pc, download them over the serial port and display them on the juicebox. The bargraph and the grid are two intrinsic graphics types that the juicebox display program already knows about.

Here is what this looks like when running:


Future development: I hope someone who is clever will rewrite these routines to only use the jtag port. The arm7 has a software break instruction,so it is possible to watch the jtag port and wait for the display program running on the juicebox to "break", then jtag data into a register and jtag a continue instruction. This would eliminate the costly serial port. You can build a jtag for less than $5. Using the jtag also eliminates the need for the sd/xd hack. So you can use the juice box as a cheap graphics display for your projects like geeXboX or other HTPC.

Here is the gzipped tarball Media:Display.tar.gz