Version 4 of Using BWise 7x5 segment block to program a DSP/Xilinx driven display

Updated 2004-12-07 16:54:02 by TV

by Theo Verelst

Using bwise, we make a display block with the

 newdisplay

procedure called from a bwise or tcl console, or with a right-click on the canvas. The resulting block has a 5x7 dot pattern on it, which however is static. To make each dot (little round oval in Tk) responsive to mouse clicks, the 'dot' tagged items are given a binding like:

 $mc bind dot <Button-1> {
    set i [$mc find withtag current];
    if {[$mc itemcget $i -fill] == "red"} {
       $mc itemco $i -fill yellow
    } {
       $mc itemco $i -fill red
    }
 }

Now clicking the left mouse button on the block makes the dots 'on' or 'off', see image below.

http://82.168.209.239/Bwise/displaybwise_a.jpg

To read the resulting pattern, the following little script is used, rendering the data in a way which leaves bit 0 zero, and reads columnwise:

 for {set i 0} {$i<5} {incr i} {
    set o {};
    for {set j 7} {$j>=0} {incr j -1} {
       set k [tag_and "display dot x$i y$j"] ;
       if {[$mc itemcget $k -fill] == "red"} { set ii 1 } {set ii 0} ;
       append o $ii
    } ;
    puts [format {%x} [fromBinary $o]] 
    puts -nonewline "0x[format {%x} [fromBinary $o]], "
 } ; puts {}

The result looks like:

   unsigned char dis57[8] = {0xf8, 0x24, 0x22, 0x24, 0xf8} ;

Minus the prepended unsigned char .... etc. The hex numbers are used in the Blackfin DSP interupt routine to respond to the row counter index coming from the Xilinx based display multiplexer I made, which writes the right column word back to the xilinx which drives the display with it.

The result is visible in the next image:

http://82.168.209.239/Bwise/display57_a.jpg

See also [L1 ] and [L2 ] where in a little while I''ll have added the Xilinx CPLD demo board and EZLITE BF533 DSP board (Open) Sources (Check back later, I'm a bit busy right now).

Tcl sucks ??? No, I don't think so. If the Analog Devices VisualDSP environment would have more tcl included in it (it does some tcl scripting with the built in 8.3, but not so much, see VisualDSP builtin Tcl use), the whole process might be automated. And Xilinx can be programmed in VHDL, too, though the devenv (webpack) has no scripting possibility to my knowledge, which can also be automatically generated with tcl, and of course from bwise. That should prove powerfull enough for some real work.

http://82.168.209.239/Bwise/blackfinxilinxdisplay1.jpg

The line at the bottom of the A in the actual display image is reversed because of a 'hardware' cursor running over the display, which happened to be there at the time of the picture-click...