Stockly.com Forums  

Go Back   Stockly.com Forums > TS-7250 > Hardware

Notices

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 02-13-2005, 11:48 PM
Grant Stockly Grant Stockly is offline
Administrator
 
Join Date: Jan 2005
Posts: 447
Default Interfacing to GPIO

I don't understand ARM assembler yet, but here is a test of I/O throughput.

C code:
loop:;
getl(IO_ADDRESS(GPIO_PADR)) = 0x01;
getl(IO_ADDRESS(GPIO_PADR)) = 0x00;
goto loop;


Generated assembler:
.L9:
mov r2, #1
ldr r3, .L10+8
mov r1, #0
str r2, [r3, #0]
str r1, [r3, #0]
b .L9

As you can see, reloading the values 0x00 and 0x01 within the loop is stupid, but hey...

//loop:;
// getl(IO_ADDRESS(GPIO_PADR)) = 0x01;
// getl(IO_ADDRESS(GPIO_PADR)) = 0x00;
//goto loop;

asm("mov r2, #1\n" \
"mov r1, #0\n" \
"ldr r3, .L10+8" \
".ASDF:\n" \
"str r2, [r3, #0]\n" \
"str r1, [r3, #0]\n" \
"b .ASDF\n");

printk("You might as well remove this module, its done...");
I can fix that...just by what I can guess of the assembler meaning...

Now in my test3.S file:

mov r1, #0
ldr r3, .L10+8
.ASDF:
str r2, [r3, #0]
str r1, [r3, #0]
b .ASDF

But in order to get a good reading, I want a waveform without so much of the jump instruction:

mov r1, #0
ldr r3, .L10+8
.ASDF:
str r2, [r3, #0]
str r1, [r3, #0]
str r2, [r3, #0]
str r1, [r3, #0]
str r2, [r3, #0]
str r1, [r3, #0]
str r2, [r3, #0]
str r1, [r3, #0]
str r2, [r3, #0]
str r1, [r3, #0]
str r2, [r3, #0]
str r1, [r3, #0]
str r2, [r3, #0]
str r1, [r3, #0]
b .ASDF

And the results are (from a kernel device driver):

(Well, don't forget about PADDR... )

8.35MHz

Upon reading the manual, the GPIO is on the lower power / lower speed APB bus. Using the PC104 bus may proove to be faster. Using a few latches on the address/data bus, an AND gate on the IOR/IOW line avery simple and faster I/O port can be made.
Reply With Quote
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:28 PM.


Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2024, vBulletin Solutions, Inc.