Can somebody assist me upon this.
By default 3V is coming at DIO1 pin4.what data register value I supposed to set
to toggle the o/p 3.3v and 0v.
Will it be PCDR:0xFE for 0v??
PCDR:0X01 FOR 1V.??
--- In "ts7300" <> wrote:
>
> Have doubt in manual mention make bit0 as output for portC.For LED ON
> *PCDR &= 0xFF; and For LED OFF *PCDR &= 0x00; These data value I have to
> Give.
> --- In "ts7300" <ts7300@> wrote:
> >
> > I am using TS-7300 and want to control the I/0 of board via connecting LED
> > to I/O Board.And using DIO1 PIN4 of board.
> > Below are the C code:
> > #include<unistd.h>
> > #include<sys/types.h>
> > #include<sys/mman.h>
> > #include<stdio.h>
> > #include<fcntl.h>
> > #include<string.h>
> >
> > int main(int argc, char **argv)
> > {
> > unsigned char *start;
> > volatile unsigned int *PCDR, *PCDDR;
> > int fd = open("/dev/mem", O_RDWR);
> >
> >
> > start = mmap(0, getpagesize(), PROT_READ|PROT_WRITE, MAP_SHARED, fd,
> > 0x80840000);
> > PCDR = (unsigned int *)(start + 0x08); // port c data register
> > PCDDR = (unsigned int *)(start + 0x18); // port c direction register
> >
> > *PCDDR = 0x01; // Make bit 0 an output Port C bit 0 is connected to the
> > LED
> >
> > *PCDR &= 0xFE; // Turn the LED on
> > sleep(30); // Output on for 30 seconds
> > *PCDR |= 0x01; // Turn the LED off
> >
> > close(fd);
> > return 0;
> > }
> > And Problem is that after 30 seconds its no becoming low(LED off).Keep on
> > giving +3V on PIN4 of Board.
> > Will anybody have an idea about that???
> >
>
------------------------------------
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/
|