2005-05-12 02:34 AM
2003-06-23 08:50 PM
Hello,
I am using the STPC Elite. I would like to configure the registers controlling the GPIO. However, the values that I set in the control registers are never set, and the default value always stays there. For example: When I set a value to register 0x320 (Port Direction Control), it's value always stays 0xFF. How do I enable and control the GPIO? Thanks!2003-06-23 09:33 PM
The GPIOs are set using the miscelaneous register on the PCI. That is register 40h.
Before you can use the GPIOs, you need to enable them via this register.2003-06-23 11:18 PM
To access register 40h, what values should I set to Register 0xCf8 -
Enable - 1??? Bus number - ??? Device number - ??? Function number - ??? Register number - 40h Thanks!2003-06-25 02:08 AM
When accessing the PCI configuration registers - register 0xCF8 has 6 bits for the register number (bites 2...7). It means that the highest register number that can be accessed is 0x3F.
How can I access the SOUTH BRIDGE MISCELLANEOUS REGISTER which has offset of 0x40? Thanks!2003-06-25 02:41 AM
The register number is 8 bits large! The contend of the 0xcf8 register is:
1BBBBBBB BBBBBBBB DDDDDFFF RRRRRRRR bit 31----------bit 0 B=Bus, 15 bits, 16-30 D=Device, 5 bits, 11-15 F=Function, 3 bits, 8-10 R=Register, 8 bits, 0-7 (bit 31 is always to 1) Farfalla [ This message was edited by: Farfalla on 25-06-2003 15:13 ]2004-02-06 08:36 AM
So that would be 0x80006040, resulting in something like this(?):
Code:
<BR>mov ax, 80006040h ;SB_Misc0 <BR>mov dx, 0cf8h <BR>out dx,ax <BR> <BR>mov ax 2 ; enable gpio <BR>mov dx, 0cfch <BR>out dx,ax <BR>
Then we are free to do I/O to 320..327 for the lower byte of gpio, no? [ This message was edited by: Gordon on 06-02-2004 22:07 ]2004-02-23 12:03 PM
Turns out, my suggestion wasn't complete
First of all, the SBMisc0 register has to be accessed with a 32b access. Then you can do it. This works better:Code:
mov eax, 80006040h mov dx,0cf8h out dx,eax ; mov dx,0cfch in al,dx or al,2 out dx,al ; now you have access to the gpio xor al,al ; make all lower byte outputs mov dx, 0320h out dx,al ;now out to 0326h appears on the gpio port pins Enjoy!2005-05-12 02:34 AM
Do you know how to check with their supplied excecutable for checking registers, mio, whether this enable is working?
Thanks, AdamQuote:
On 24-02-2004 at 01:33, Anonymous wrote: Turns out, my suggestion wasn't complete First of all, the SBMisc0 register has to be accessed with a 32b access. Then you can do it. This works better:Code:
mov eax, 80006040h mov dx,0cf8h out dx,eax ; mov dx,0cfch in al,dx or al,2 out dx,al ; now you have access to the gpio xor al,al ; make all lower byte outputs mov dx, 0320h out dx,al ;now out to 0326h appears on the gpio port pins Enjoy!