Saturday, January 22, 2011

Bauble displayed

One of Claire's graphics

It works!! Christmas tree display

This is animated with twinkling lights, but that's obviously not apparent from this still shot.

Controller board mounted

With 20 row and 24 column wires connected.

Wooden Dividers Holding Apart Wires

Done last week - to avoid the horizontal column wires and vertical row wires from touching in the middle. They hold down the row wires and hold up the column wires.

Saturday, January 15, 2011

LED display progress

Now 479 LED's soldered onto the board. One LED must have got damaged - so I've ordered a replacement. (Claire did loads of winding and soldering - and found a location with two LEDs soldered on... what a wonderful wife!)

Additionally I've got a 'computer emulation' of the display. It uses the same high level Forth display words and a different set of low level words to display it in a text terminal window.

I used pForth on the computer. pForth a public domain Forth written by Phil Burk in C and it's very portable. I only needed to modify it for one specific thing - to add nanosleep for timing.

Although BVForth has some weird words for Forth (for, next, // commands, VSPACE$, ms) I was able to emulate all of those with little problems. The '&' preceding a hex number is a bit of a pain for a Forth engine. The normal Forth syntax is characters separated by space - so special parsing would require a new accept - not major problems - but it moves it away from standard Forth. Anyway I've limited the hex numbers to &ffffff and all other numbers are decimal. Not a major problem.

Getting closer...

Tuesday, January 04, 2011

Hundreds of LED's - text

(This was meant to be posted with the previous picture)

One hundred exactly left to do. Lots of help from Claire, Ron, Linda.

Made slightly more difficult by the fact that about 50 have resistors soldered on the leg of the LED right next to the head under plastic covering. Another good number had three or four wires soldered onto the LED which needed to be reduced to two.

However, the general process is: cut from chain, strip ends, test for cathode/anode and mark, twist wire, twist onto grid of tinned copper wires, solder. Very time consuming.

Hundred of LEDs!!

Monday, January 03, 2011

Testing a port

Here is a bit of code that I've been using to test microprocessor pins (also know as ports).

// ( port# -- )
: test_port0
// program port as an output
." Testing port 0." dup . ." ->"
dup p0_out_bit
BEGIN
dup p0set_bit ." 1"
500 ms
dup p0clear_bit ." 0"
500 ms
KEY? UNTIL
KEY drop
drop
CR
;


This word turns the selected output on and off every half a second (500 milliseconds) until a key is pressed. ('Word' is the Forth name for what other languages call functions, procedures or methods)

I won't explain all of the detail, but here are some bits worth noting.
  1. The // comment is supported on this Forth platform but not normally. The more traditional backslash (\) to end of line comments and round brackets (parentheses) are also supported.
  2. p0_out_bit, p0set_bit and p0clear_bit are words I created earlier. These do the following: p0_out_bit turns a particular pin (port) into an output, p0set_bit turns a pin high (on, 3v) and p0clear_bit turns a pin low (off, 0v).
  3. Forth syntax is words or numbers separated by spaces.
  4. Forth stores values on the stack, so 500 ms will store 500 onto the stack and the word 'ms' on this Forth system waits for that number of milliseconds.
  5. The Forth word ':' (colon) defines a new word called the name that follows it. The Forth word ';' (semicolon) ends that new word creation process.
  6. The BEGIN marks the start of the loop and the UNTIL marks the end of the loop. UNTIL will loop until it gets a true (In the above case KEY? produces a true when a key is ready).
  7. This Forth system is not case sensitive - so it doesn't matter whether the words are spelt DROP or drop.
To use this word you would type:
31 test_port0
This will print:
Testing port 0.31 ->setting31
101010101010101010
On this system, port 0.31 is the on-board LED, and hence this particular example will flash the LED. (Note: the 'setting31' is test output printed by p0_out_bit)

Update on ‘broken’ output ports and other trivia

P0.2/P0.3 (port not going high) -- 10K pull up on each port fixed problem.

P1.22 (port ok, row transistor not going high) -- solder short on output resistor on controller board. No danger to any device, short removed.

P1.28 (port being low) -- This was a bit of solder between the actual microprocessor IC pins for P1.28 and VSS_A. Moved with a scalpel. (Most likely during construction of controller board rather than a manufacturing fault on the microprocessor board).


P0.23 -- The ‘flickering’ on logic high seems to occur when my hand or the whole board is near the computer. This doesn’t happen on other ports. Logic low doesn’t seem to do this. When in circuit it seems ok (although slightly noisy under same circumstances) - so I’m going to leave it for now and see if it causes a problem on that row. The port voltage itself seems ok, and the transistor for that row isn’t turning on.

For interest, here are the port assignments used for the display.

Function -- Position -- Port

Row Select Number (Inverted) -- bit 0 (LSB) -- P0.2
Row Select Number (Inverted) -- bit 1 -- P0.3
Row Select Number (Inverted) -- bit 2 -- P0.4
Row Select Number (Inverted) -- bit 3 -- P0.5
Row Select Number (Inverted) -- bit 4 (MSB) --P0.6

Column Enable (1=on) -- 7 to 23(MSB, left-most of graphic) -- P1.16 to P1.31
Column Enable (1=on) -- 2 to 6 -- P0.25 to P0.30
Column Enable (1=on) -- 0 (LSB, right-most of graphic) to 1 -- P0.22 to P23

NOTES
  • Row Select Number 0 = top row
  • Row Select Number 19 = bottom row


The split of column enabled into three ranges is mainly due to the available ports on the microprocessor board, but this are not a problem since we operate basically in the range of milliseconds, and code to split up the graphic is trivial. (I’ll share this in a future post.)



A Note on terminology:

I use the term microprocessor and microprocessor board rather than microcontroller and microcontroller board in order to clearly separate it from the LED display ‘controller board’ in this blog post and the previous one.

Christmas project - update

Two things took longer than I expected. The biggest job was definitely soldering the 480 LEDs and that is still half done.

Making and soldering the controller board also took longer than I expected. Part of this was transferring the design to stripboard - I'd 'paper designed' the chip and transistor pin connections but there were placement and wiring issues.

Three placement/wiring issues worth noting were: 1. between the microprocessor board and logic gates (3-8 line converters), 2. transistor placement/spacing and 3. microprocessor board connector (where I had to create a connector).

On the controller board, so far, there are five ports giving problems. Two are related to the ports (P0.2/P0.3) being for I2C (as well as other functions) and therefore don't have active pull up to high (open-drain/open-collector type ports). Just requires some resistor pull-ups.

Another port works but the transistor output is not toggling. It's obviously a board or transistor problem and should be simple enough to fix.

Another port is not toggling even when the controller board is disconnected - even the micro pin is not toggling.

Finally there is one port which is toggling but the logic probe seems to show it 'rattling' when it's high. This will also need investigating.

There are a few other things to do after the LED soldering and port fixing, like making sure the LED matrix wires are separated, completing the box construction, fixing the black facia board on, finishing the controller board hardware debugging and adding pictures to display.

Newer›  ‹Older