ts-7000
[Top] [All Lists]

[ts-7000] Re: switch a 5v dc power switch off the DIO ts-7200

To:
Subject: [ts-7000] Re: switch a 5v dc power switch off the DIO ts-7200
From: "naturalwatt" <>
Date: Fri, 15 Feb 2008 12:32:48 -0000
--- In  "Ashley" <> wrote:
>
> Thanks, It didn't even come to me that they were 5v and 3.3. Does
> anyone have some source code for writing the DIO line high for the
> transistor?
> 

This should point you in the right direction.

#define DIO0  0x01
#define DIO1 0x02
#define DIO2 0x04
#define DIO3 0x08
#define DIO4 0x10
#define DIO5 0x20

        volatile unsigned char *pbdata, *pbddr;

        int mem = open("/dev/mem", O_RDWR);
        unsigned char * start = mmap(0, getpagesize(), PROT_READ|PROT_WRITE, 
MAP_SHARED, mem, 0x80840000);
        pbdata = (unsigned int*)(start + 0x04);
        pbddr = (unsigned int *)(start + 0x14);
        // All inputs
        *pbddr = DIO4 | DIO5;  // DIO 4/5 outputs.
        *pbdata = 0xff;         // set to all 1's

By setting a bit in the DDR to 1, you set it to be an output.  (This is 
opposite to my past 
experience, where 0 = Output and 1 = Inpput.  More memorable that way around).

Martin





 
Yahoo! Groups Links

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

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/ts-7000/join
    (Yahoo! ID required)

<*> To change settings via email:
     
    

<*> 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