To: | |
---|---|
Subject: | [ts-7000] Re: Problem with DIO1 on TS7300 |
From: | "Alvaro Aguirre" <> |
Date: | Tue, 14 Nov 2006 19:59:07 -0300 |
I solved it... I'm not so sure what's the difference but I paste the code if anyone in the future has the same problem. I get the answer on http://www.simtec.co.uk/appnotes/AN0014/
. #include <sys/mman.h> #include <unistd.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <stdio.h> void button_init(void){ void *PBDR, *PFDR, *PBDDR, *PFDDR; void *start; int fd; //Abrimos el dev/mem fd=open("/dev/mem", O_RDWR | O_SYNC); //Obtenemos el puntero a la memoria start=mmap(0, getpagesize(), PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0x80840000); //Asignamos los punteros a los registros necesarios PBDR= (start + 0x04); // port b; PBDDR= (start + 0x14); // port b ddr; PFDR= (start + 0x30); // port f; PFDDR= (start + 0x34); // port f ddr; //seteamos los ddr y debouncing *(volatile unsigned char *)PBDDR &= 0x04; *(volatile unsigned char *)PFDDR &= 0xfd; while(1){ printf("%x,%x\n",*(volatile unsigned char *)PBDR,*(volatile unsigned char *)PFDR); usleep(100000); } } On 11/14/06,
Alvaro Aguirre <> wrote: I check the memory and when i put a signal on the pin5 i get it mapped on 0x20 (bit 1) which is Port E bit 1!? __._,_.___
SPONSORED LINKS
Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required) Change settings via email: =Email Delivery: Digest | m("yahoogroups.com?subject","ts-7000-fullfeatured");=Change Delivery Format: Fully Featured">Switch to Fully Featured Visit Your Group | Yahoo! Groups Terms of Use | =Unsubscribe __,_._,___ |
<Prev in Thread] | Current Thread | [Next in Thread> |
---|---|---|
|
Previous by Date: | [ts-7000] Re: Update Debian on USB, chentom60 |
---|---|
Next by Date: | Re: [ts-7000] error on "make dep": cannot execute binary file, Joe Bouchard |
Previous by Thread: | [ts-7000] Re: Problem with DIO1 on TS7300, Alvaro Aguirre |
Next by Thread: | [ts-7000] Re: Problem with DIO1 on TS7300, Phil |
Indexes: | [Date] [Thread] [Top] [All Lists] |
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