ts-7000
[Top] [All Lists]

Re: [ts-7000] problem in writing my first program in pc104

To:
Subject: Re: [ts-7000] problem in writing my first program in pc104
From: Jim Jackson <>
Date: Sun, 11 Feb 2007 14:59:29 +0000 (GMT)
You want to try these changes....

On Fri, 9 Feb 2007, HOSAM YOUSIF wrote:

> hi all
> i have a question that i want to do an experment that i want to write
> a progrme to make a flasher on 8-leds connected to 8-bit pc/104 pins
> i write this code but that not work
> plz any one help me
> my second question about the cureent on pc/104 pins that when it output
> #include<unistd.h>
> #include<sys/mman.h>
> #include<fcntl.h>
> int main()
> {
> volatile unsigned int *PFDR;

make it unsigned char *

> int i;
> unsigned char * start ;
> int fd=open("/dev/mem",O_RDWR);
> start=mmap(0,getpagesize(),PROT_READ|PROT_WRITE,MAP_SHARED,fd,0x11e00000);
> PFDR=(unsigned int*)(start+0x00);

make it (unsigned char *)

> *PFDR=0x00;
> for(i=0;i<10;i++)
> {
> *PFDR=0xff;
> sleep(2);
> *PFDR=0x00;
> sleep(2);
> }
> close(fd);
> return 0;
> }
>

It makes it simpler if you keep the pointer types to size of data you are
handling on the interface - this prevents bigendian problems hiding your
data byte.

Jim


 
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