ts-7000
[Top] [All Lists]

[ts-7000] Re: [electronic] 7-segment LED

To:
Subject: [ts-7000] Re: [electronic] 7-segment LED
From: Mike Dodd <>
Date: Wed, 02 Nov 2005 19:08:34 -0500
>That works !!! :) A big thanks to Keith and Mike :)

Good; glad to here you got it working.

>*sigh* There is just one thing, need to negate DIO.
>
>Example:
>"4" : D=0 C=1 B=0 A=0
>I must swap 0 to 1 and 1 to 0 and send as input D=1 C=0 B=1 A=1 to have
>my "4" digit.
>Is there any simple way to fix that ?

Sure; do it in software. Assuming you know the C language, and have tried 
some of the simple test programs in this list's Files section, you should 
know how to write to an I/O port on the TS-72xx. So:

volatile unsigned int *portA;
unsigned int theData;

// Want to turn on display segments A, B, and D, assumed
// to be bits 0, 1, and 3.
theData = 0x000b;  // 00001011 (ignoring high bits)
theData = ~theData;   // Invert all bits = 11110100 (ignoring high bits)
*portA = theData;   // Write the data

Needless to say, there's more you could/should do, like masking off the 
extra bits, or maintaining the state of other bits on the port you don't 
want to disturb.

Example:
To mask bits 4-7: theData &= 0x0000000f;   // Mask is 00001111 (ignoring 
high bits)

Mike


------
Mike Dodd - Montpelier, VA
http://www.mdodd.com



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life.
http://us.click.yahoo.com/A77XvD/vlQLAA/TtwFAA/CFFolB/TM
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/ts-7000/

<*> To unsubscribe from this group, send an email to:
    

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


<Prev in Thread] Current Thread [Next in Thread>
Admin

Disclaimer: Neither Andrew Taylor nor the University of NSW School of Computer and Engineering take any responsibility for the contents of this archive. It is purely a compilation of material sent by many people to the birding-aus mailing list. It has not been checked for accuracy nor its content verified in any way. If you wish to get material removed from the archive or have other queries about the archive e-mail Andrew Taylor at this address: andrewt@cse.unsw.EDU.AU