ts-7000
[Top] [All Lists]

[ts-7000] Re: Correct procedure to do GPIO on the EP9302?

To:
Subject: [ts-7000] Re: Correct procedure to do GPIO on the EP9302?
From: "Phil" <>
Date: Tue, 23 Aug 2005 08:04:08 -0000
Hi Kaiwan,

Having a quick look over your code, I can see one issue that I think 
would be making a big difference.

Your "gpio" pointer is declared at the start as "volatile unsigned 
short *" but the offsets that you are adding to it to reach 
each particular port are BYTE offsets. So for example if you 
add PBDR_OFF (which is 0x04) to the gpio pointer, you will actually 
be referencing 4 short integers past gpio or 8 bytes past it. (I 
hope you understand my explanation)

Hopefully, that's the only problem.. I haven't done much assembler 
for the arm, so I can help with the peek/poke code, other than 
saying that you shouldn't really need to go to those lengths.. look 
at the code that others have suggested, or at the example in the TS-
7200 manuals for the optional ADC which shows reading/writing to 
registers.

Cheers
Phil


--- In  Kaiwan N Billimoria <> 
wrote:
> Hi All,
> 
> Am attempting to write a user-space driver program to use the DIO 
header 
> facility on the TS-7200.
> I get access via mmap() to the gpio base addr (0x80840000), then 
set 
> (poke) the PxDDR register (where x is one of A-C, E-H) for output 
> (setting some bit(s) high), then attempt to write (poke) the 
> corresponding PxDR register. AFAIK that's the procedure to be 
followed 
> according to the EP9301 User Manual. Am I right until here?
> 
> Well, it seems that no matter what GPIO DDR register i'm writing 
to and 
> what bit patter is being written, it's value (when peeked) is 
0xff. ?? 
> For example, trying to use Port B, I write 0x04 to PBDDR, but on 
peeking 
> it's value is 0xff. So, measuring w/ a voltmeter on the DIO header 
I can 
> see that all relevant Port B lines are high.
> What I require is that my program can set the lines (DIO0 thru 
DIO7) 
> selectively.
> 
> Of course this is all a moot point if this is not the "right" way 
to do 
> GPIO in the first place. Any inputs would be appreciated..
> 
> (For those who want to see the source file i've currently written 
(and 
> got stuck on), pl find it here:
> http://www.designergraphix.com/kaiwan/projects/gpio/TS7200-
gpio.html  ).
> 
> Regards,
> Kaiwan.








------------------------ Yahoo! Groups Sponsor --------------------~--> 
<font face=arial size=-1><a 
href="http://us.ard.yahoo.com/SIG=12h67pmd9/M=362329.6886308.7839368.1510227/D=groups/S=1705005378:TM/Y=YAHOO/EXP=1124803129/A=2894321/R=0/SIG=11dvsfulr/*http://youthnoise.com/page.php?page_id=1992
">Fair play? Video games influencing politics. Click and talk back!</a>.</font>
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/ts-7000/

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