ts-7000
[Top] [All Lists]

Re: [ts-7000] [ts 7200] DIO Code

To:
Subject: Re: [ts-7000] [ts 7200] DIO Code
From: "Giulio D'Aversa" <>
Date: Sun, 14 Nov 2010 17:15:46 +0100




On Sun, Nov 14, 2010 at 3:56 PM, Joel Morgan <> wrote:
 

Hi Alba,
looks ok but I dont think its doing what you want. See below.



On 11/14/10, Giulio D'Aversa <eolone%40gmail.com> wrote:

>> unsigned char *start;
>> int fd = open("/dev/mem", O_RDWR);
>>
>> // TRACE(printf("DIO_SETUP()\n"));
>> start = mmap(0, getpagesize(), PROT_READ|PROT_WRITE, MAP_SHARED, fd,
>> 0x80840000);
>> // DIO registers
>> PBDR = (unsigned int *)(start + 0x04); // port b
>> PBDDR = (unsigned int *)(start + 0x14); // port b direction register
>> PEDR = (unsigned int *)(start + 0x20); // port e data
>> PEDDR = (unsigned int *)(start + 0x24); // port e direction register
>> GPIOBDB = (unsigned int *)(start + 0xC4); // debounce on port b
>> GEN_DBG_PRT_DEBUG_FL("ok1\n");
>> fflush(NULL);
>> *PBDDR =0xFF;

Port B is all outputs.


>> *PBDR=0x01; // upper nibble output,

You turn on bit 0


>> *GPIOBDB = 0x01; // enable debounce on bit 0

why debounce an output?
 
I found this  on the web and I forgot to remove the GPIOBDB line.
The point is that the code doesn't run..the bash shell write something weird and ":not found" for the first 2 lines
and something else like "sintax errounexpected  '(' "

here the screen
http://img138.imageshack.us/img138/8190/22541950.jpg

Alba




>> GEN_DBG_PRT_DEBUG_FL("ok2\n");
>> fflush(NULL);
>>
>> // *PEDDR = 255; // all output (just 2 bits)
>> close(fd);
>> //}
>>
>> }

--
Joel R. Morgan
Morgan Millwright Services, Inc.
Linux User #504110 http://counter.li.org/



__._,_.___


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>
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