My bad

Try this one

Grahame Jordan wrote:

I have modified gpregs.h to enable it to reach the extra regs for PXA270.
See attached


Grahame Jordan

Anch wrote:
Hi Timo,
I just posted a solution in this post as a reply to matthew. You can go
through it. Also, the code to control GPIO doesnot work for GPIO's greater
than 84 ( think its 84, but am not sure about the exact number, but I am
sure it doesnt work for 101) Its meant for PXA255 and not PXA270. 
if you go through the manual for PXA270, you will realise that memory
addresses for gpios greater than 84 do not follow a continuous address
range. so I made changes like below:
void gpio_set(u32 gpio)
    u32 pos;
    u32 bit = 1;
    pos = gpio / 32;
    bit <<= gpio % 32;
    	putmem(GPSR3, bit);
    	putmem(GPSR0 + (pos * 4), bit);

void gpio_clear(u32 gpio)
    u32 pos;
    u32 bit = 1;

    pos = gpio / 32;
    bit <<= gpio % 32;
    	putmem(GPCR3 , bit);
    	putmem(GPCR0 + (pos * 4), bit);

u32 gpio_status(u32 gpio)
    u32 pos;
    u32 bit = 1;
    u32 data;

    pos = gpio / 32;
    bit <<= gpio % 32;
    if(pos > 2)
    	data = getmem(GPLR3);
    	data = getmem(GPLR0 + (pos * 4));
    data &= bit;
    if (data == 0)
void gpio_direction(u32 gpio, u32 dir)
    u32 pos;
    u32 bit = 1;
    u32 data;

    pos = gpio / 32;
    bit <<= gpio % 32;
    if(pos > 2)
    	data = getmem(GPDR3);
    	data = getmem(GPDR0 + (pos * 4));
    data &= ~bit;
    if (dir == OUT)
      data |= bit;
    if(pos > 2)
    	putmem(GPDR3 , data);
    	putmem(GPDR0 + (pos * 4), data);

>From the manual define the addresses of different registers. You might need
to make changes to other functions too.

Once you are done with this code, you will have to depatch a few gumstix
serial patches to read serial control registers like LSR which tell you when
the tx buffer is empty, so that you can drive the control line low.
Idescribed this in a previous post.

Hope this helps


Timo Birnschein wrote:
Hi Matthew,

I'm glad you got this problem solved! I would be very very happy to get
some support since I'm currently working on the same problem - almost.
I'm trying to connect Dynamixel Servos XD-117 directly to the Gumstix
Verdex 6 pro using a MAX485 soldered to ttyS1 (BTUART) and I want to use
GPIO101 to set the data direction.
I'm able to control GPIO101 using the shell command from one of the first
posts but I'm not able to get any reaction using the code from here:

I ported the code to a C++ class, so that I'm able to use it from my
project. I didn't change anything else in the code.

So, how did you solve the problem? Did you use the mmap() stuff from the
link above? What do you do exactly, and what for? 

I need extremly low response times as well because I have to control 12
servos with just one RS485 port and I want to read some values from them
as well.
Any further details on what you did and maybe some lines of code or
references would be very helpfull to conclude this excelent thread! :)

With best regards,

Matthew Bowles-2 wrote:
Many many thanks for the the great help (and the grunt work) from Dave

I actually got it to work.
If anyone is interested I will posting my solution in a relatively
way with a new topic heading to make it easier for future gumstix users
find via nabble.

but essentially, I used the same approach as covered here ->, with some
adjustments to work with the HWUART on my gumstix. I could successfully
the trasnmitter empty flag. This appears to work in FIFO mode and

I'm extremely pleased. It's actually my birthday today - and I think I've
just got the best present. :) 
Tickled Pink is the proper phrase I believe.

While i don't have the RS485 hooked up to test yet because I'm still
on hardware, my scope shows the packet being sent and the transmit-enable
toggling the right way at exactly the right time.

Best regards
Matt Bowles
Embedded Systems Engineer
aWma Pty Ltd



------------------------------------------------------------------------------ Come build with us! The BlackBerry&reg; Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;

_______________________________________________ gumstix-users mailing list