To: | |
---|---|
Subject: | [ts-7000] Problem with DIO1 on TS7300 |
From: | "Alvaro Aguirre" <> |
Date: | Tue, 14 Nov 2006 15:57:47 -0300 |
I wrote a very simple function to get readings from the pin 1,3,5,7,9 and 11 from DIO1 on my TS7300 but the results are confusing. The value of *PFDR changes when pin 1,3,7,9 and 11 are grounded and *PBDR doesn't change at all. Reading the TS7300 manual *PBDR must change when signals come from pin 1,3,7,9 and 11 and *PFDR on pin 5. What i'm doing wrong? i'm using a kernel builded by my self (with a fix only on the framebuffer)... please help! #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){ volatile unsigned int *PBDR, *PFDR; volatile unsigned int *PBDDR, *PFDDR, *GPIOBDB, *GPIOFDB; int *offset; int fd; //Abrimos el dev/mem fd=open("/dev/mem", O_RDWR | O_SYNC); //Obtenemos el puntero a la memoria offset=mmap(0, getpagesize(), PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0x80840000); //Asignamos los punteros a los registros necesarios PBDR= (unsigned int *)(offset + 0x04); // port b; PBDDR= (unsigned int *)(offset + 0x14); // port b ddr; PFDR= (unsigned int *)(offset + 0x30); // port f; PFDDR= (unsigned int *)(offset + 0x34); // port f ddr; GPIOBDB=(unsigned int *)(offset + 0xc4); // port b debouncing; GPIOFDB=(unsigned int *)(offset + 0x64); // port f debouncing; //seteamos los ddr y debouncing *PBDDR &= 0x04; //Todos entradas menos el DIO_2 *PFDDR &= 0xfd; //Solo entrada el DIO_8 *GPIOBDB |= 0xfb; //debounce en todos los bits menos DIO_2 *GPIOFDB |= 0x02; //debounce en el DIO_8 while(1){ printf("%x,%x\n",*PBDR,*PFDR); usleep(100000); } } __._,_.___
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: Dealing with unexpected power supply loss in ucLinux?, Yan Seiner |
---|---|
Next by Date: | Re: [ts-7000] Re: Update Debian on USB, Jim Jackson |
Previous by Thread: | [ts-7000] Re: Update Debian on USB, Yan Seiner |
Next by Thread: | [ts-7000] Re: Problem with DIO1 on TS7300, Alvaro Aguirre |
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