Software

Home Hardware Software Contacts Pictures

Program Flow Diagram

Program Description

Start Up:

 Reset

Time reset to initial value, display cleared.

 Initialize

Port direction and logic levels set, interrupts configured and enabled. 

Main:

 Infinite Loop

Program loops awaiting interrupt.

 Functions:

Increment Time

Time incremented by one second or digits rolled over. 

Prepare Display Value

Time digits and LED lighting sequence deliberated and stored. 

Display

Lights LEDís dependant upon position.  Tracks board position.

Interrupts:

  External, Hall Effect Sensor:

 Update Board Position

Hall Sensor generates pulse indicating LEDís have spun past top, upright position.  Display called to reference the position from this point as 0o.

Internal, Timing:

Degree Increment

Position of LEDís is incremented by one degree when 1/360 th of the time it took for the board to spin once has passed.  Display called to increment position. 

Timekeeping

Timer overflows every second, generated interrupt, allows call to Increment Time function.   

 

Click here to view Program Source Code

 

Positioning Diagram

The characters which make up the time display are referenced with respect to 0 degrees and displayed from 100 degrees to 244 degrees.

Character Map

PB0

0

1

1

1

0

0

1

1

0

0

0

1

0

0

0

1

1

1

0

0

1

1

1

1

PB1

1

0

0

0

1

0

0

1

0

0

0

1

0

0

1

0

0

0

1

0

0

0

0

1

PB2

1

0

0

0

1

0

0

1

0

0

0

0

0

0

1

0

0

0

1

0

0

0

0

1

PB3

1

0

0

0

1

0

0

1

0

0

0

0

0

0

1

0

0

0

1

0

0

0

0

1

PB4

1

0

0

0

1

0

0

1

0

0

0

1

0

0

1

0

0

0

1

0

0

0

1

0

PB5

1

0

0

0

1

0

0

1

0

0

0

1

0

0

1

0

0

0

1

0

0

1

0

0

PB6

0

1

1

1

0

0

1

1

1

0

0

0

0

0

0

1

1

1

0

0

1

1

1

1

 

Character mapping example - The number displayed above is 01:02. This number is displayed by illuminating LEDs on PortB, beginning with the right-most column for clockwise rotation of the board.