ts-7000
[Top] [All Lists]

[ts-7000] 7400 question using DIO

To:
Subject: [ts-7000] 7400 question using DIO
From: "mrjbradski" <>
Date: Sat, 29 Dec 2007 06:13:51 -0000
Im just experimenting with DIO before I actually need to use it, so I
wrote a simple program to toggle the DIO0..7 pins as follows:

        fd = open("/dev/mem", O_RDWR|O_SYNC);
        gpioregs = (char *)mmap(0, 4096, PROT_READ|PROT_WRITE, MAP_SHARED,fd,
0x12c00000);
        gpioregs[0] = 0xff; /* data direction register set to all outputs */
        
        for (;;) {
                gpioregs[2] = 0xff; /* output high to DIO_01 and DIO_4, all 
else low */
                gpioregs[2] = 0x0; /* output high to DIO_01 and DIO_4, all else 
low */
        }
        close(fd);
        exit(0);

For some reason, the pins never toggle. If I remove the for loop, and
execute gpioregs[2] = 0xff; OR gpioregs[2] = 0x0; the pins will change
state. What am I doing wrong?

Rich



 
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