Good morning,
We're developping a robot and we use a TS7260 to control it.
We have a problem : we would like to use the DIO2 port like a simple input /
output port.
We don't manage to configure the "MODE 0" on the fpga, even by using function
provided by
the card documentation.
This a code we used to set the mode 0 :
int main(void)
{
unsigned char *start;
int i;
fd = open("/dev/mem", O_RDWR|O_SYNC);
start = mmap(0, getpagesize(), PROT_READ|PROT_WRITE, MAP_SHARED, fd,
0x12C00000);
BASE0 = (unsigned char *)(start + 0x00); //port BASE0;
BASE1 = (unsigned char *)(start + 0x01); // port BASE1;
BASE2 = (unsigned char *)(start + 0x02); // port BASE2;
BASE3 = (unsigned char *)(start + 0x03); // port BASE3;
*BASE0 = 0x0f; // or 0x3f should be enough ?
printf("%x\n",*BASE0);
printf("%x\n",*BASE1);
printf("%x\n",*BASE2);
printf("%x\n",*BASE3);
return 0;
}
We have an other question :
We tried to get the value in the base0 register and base2 register. Each time
we executed the code, these two
value changed (0xFF or 0xBF). It would be nice if you could give us a reason.
Thank you for have a look on a our mail, have a nice day.
------------------------------------
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/
|