Forum

Please consider registering
guest

Log In Register

Register | Lost password?
Advanced Search

— Forum Scope —

  

— Match —

   

— Forum Options —

   

Minimum search word length is 4 characters - maximum search word length is 84 characters

Topic RSS
Accessing GPIO on 86Duino in DOS environment and Assembly language
2018 年 11 月 06 日
04:45:11
jejump
Moderator
Forum Posts: 14
Member Since:
2015 年 02 月 22 日
Offline

Can someone please put in plain words how to configure the SouthBridge to establish a Base Address for GPIO? According to the thread below, the GPIO is disabled until this happens. I am hoping to accomplish this using assembly language:

From the referenced thread:

Hi,
The GPIO's base addresses need to be configured on EX (mean those addresses are not fixed). If not configure them, GPIO function is disable. A simple method to configure them as below for reference 86Duino source code:

1. access SouthBridge(SB) and set GPIO base address at 62h, 63h. For 86Duino, it is set as 0xF100 in standard I/O space. You can set another as you like (recommend to set a high address). Access SB method for refer to ftp://ftp.dmp.com.tw/DMP_Vorte.....091216.pdf.
2. access address 0xF100 (standard I/O space), set GPIO enable bit (0xF100h ~ 0xF103h).
3. set 0xF104 ~ 0xF107 for GPIO0's DIR base address and DATA base address, 0xF108 ~ 0xF10B for GPIO1's DIR base address and DATA base address and so on. For 86Duino, GPIO0's DIR address is set as 0xF202 and DATA address is 0xF200, GPIO1's DIR address is set as 0xF206 and DATA address is 0xF204 and so on.
4. access 0xF200 and 0xF202, you can use GPIO0, access 0xF204 and 0xF206 to use GPIO1 and so on.

In addition, to output GPIO signal, need to configure CORSSBAR as below:

1. set CROSSBAR base address at SB 0x64, 0x65. For 86Duino, it is set as 0x0A00 (standard I/O space).
2. start to access CROSSBAR function from address 0x0A00.
For reference, https://gist.github.com/nonakap/9045101.
(posted from http://www.86duino.com/?page_i.....on-educake)

Regards

Source: http://www.86duino.com/?page_i.....o-register

If anyone can guide me, I'd be extremely grateful!!

Thanks in advance,
John

2018 年 11 月 07 日
00:26:00
jejump
Moderator
Forum Posts: 14
Member Since:
2015 年 02 月 22 日
Offline

Okay,

Maybe I should back up and tell you what I THINK I have learned regarding enabling read/write on the GPIO lines through low-level language. Maybe someone can validate whether or not my understanding of this is thus far accurate.

In step 1 above, Android_Lin's instructions to Dinosaur are to access the "SouthBridge set GPIO address at 62h, 63h" but he doesn't go far enough to say exactly how to do this. I have read about PCI Configuration Address Register at 0CF8h. This register is accessible via a DOUBLE WORD access ONLY so I'm assuming the assembly language way to this will be something like:

MOV EAX, 8000####h (I don't know what this exact value should be. Another thing that I'm lost on).
MOV DX, 0CF8h
OUT DX, EAX
...
...

I think the value for EAX above is best talked about on page 202 of the Vortex86EX Fact Sheet .pdf but maybe even prior to this step, I need to read the PCI Configuration Data Register at 0CFCh and do something with that value first. There is really no good source I've found for achieving the proper steps here. I hope to gain a clear understanding for this and be able to help someone else in the future with the same goals.

Hope someone out there can elaborate!

Thanks,
John

2019 年 04 月 27 日
00:08:47
guigra
Moderator
Forum Posts: 17
Member Since:
2014 年 02 月 15 日
Offline

Hi jejump,

do you has found a solution for your problem? I have found a document which describe how to get accsess to the northbridge or southbridge in DOS.You can find it on ftp://ftp.dmp.com.tw/DMP_Vorte.....091216.pdf.
On page 17 is a very good and easy explanation how todo this.

Example : to get accsess to the northbridge (IDSEL = AD11 /Device 0) so you have to set bit 31 and bit 12 to '1'
this is 80000800 in hexadecimal
write this value to register 0xCF8h.
the next step is read the content the register 0xCFCh.

The result of these action is a long value : 601117F3 this means vendor id is 17F3h and the 6011h is the device id.

guigra

2020 年 04 月 18 日
22:29:32
jejump
Moderator
Forum Posts: 14
Member Since:
2015 年 02 月 22 日
Offline

Hey,

It's been a year an a half, and I am just now thinking again about this board. I gave up on it for a while, but now since reading your suggestion (Thank You, guigra!!), I'm going to connect it all up again and see what results. I can't remember which version of DOS I had running when I last played around with this board. Does it matter which DOS version? MS-DOS 6.22, DOS 7.10, FreeDOS, etc.. ?

Thanks Again!
John
Laugh

2020 年 04 月 18 日
22:34:12
jejump
Moderator
Forum Posts: 14
Member Since:
2015 年 02 月 22 日
Offline

Also, I'm being prompted for a password when I try to open the link you referenced. Don't know what to enter. My forum UN/PW doesn't seem to work. Confused

2020 年 04 月 21 日
09:28:01
jejump
Moderator
Forum Posts: 14
Member Since:
2015 年 02 月 22 日
Offline

Ok. I wrote a small .com program in FDOS DEBUG that gets the vendor and device ID through the PCI config/data registers. This works exactly as you said it would. I had those two word-values returned at the end of the program in eax, then stored them in memory where I could examine them. Only thing is that my device ID was not 6011. It's 1031. Don't know if that says anything new.

On another note, I have searched every related document I have for this processor and nowhere do I see how the GPIO base address
62h, 63h values get used. From the EX datasheet: (Base Address Refers to the Register of index 63h-62h, SB Function0 PCI Configuration Register) The document mentions these locations, but what are they? I/O space ports? Memory locations somewhere? It seems this is the place to start and I don't know or understand their purpose.

I'll check back in another six months to see if somebody responds.

John

2020 年 04 月 22 日
22:30:53
jejump
Moderator
Forum Posts: 14
Member Since:
2015 年 02 月 22 日
Offline

This is my update to a very similar related post on the 86Duino forum:

http://www.86duino.com/?page_i.....spPostForm

Android_Lin said

Hi,
The GPIO's base addresses need to be configured on EX (mean those addresses are not fixed). If not configure them, GPIO function is disable. A simple method to configure them as below for reference 86Duino source code:

1. access SouthBridge(SB) and set GPIO base address at 62h, 63h. For 86Duino, it is set as 0xF100 in standard I/O space. You can set another as you like (recommend to set a high address). Access SB method for refer to ftp://ftp.dmp.com.tw/DMP_Vorte.....091216.pdf.
2. access address 0xF100 (standard I/O space), set GPIO enable bit (0xF100h ~ 0xF103h).
3. set 0xF104 ~ 0xF107 for GPIO0's DIR base address and DATA base address, 0xF108 ~ 0xF10B for GPIO1's DIR base address and DATA base address and so on. For 86Duino, GPIO0's DIR address is set as 0xF202 and DATA address is 0xF200, GPIO1's DIR address is set as 0xF206 and DATA address is 0xF204 and so on.
4. access 0xF200 and 0xF202, you can use GPIO0, access 0xF204 and 0xF206 to use GPIO1 and so on.

In addition, to output GPIO signal, need to configure CORSSBAR as below:

1. set CROSSBAR base address at SB 0x64, 0x65. For 86Duino, it is set as 0x0A00 (standard I/O space).
2. start to access CROSSBAR function from address 0x0A00.
For reference, https://gist.github.com/nonakap/9045101.
(posted from http://www.86duino.com/?page_i.....on-educake)

Regards

For what it's worth to anyone now....

I have figured out from Android_Lin's reply above, that 86Duino makes use of F202h for GPIO 0 direction, and F200h for GPIO 0 data. I spent weeks trying to make this be true and kept coming up with nothing. My biggest setback was because I had no peripheral test set up for any GPIO port pin. I was solely relying on the PIN 13 LED on the board as my indicator as to whether or not I was correctly addressing the port and pin (That would be F206 DIR, F204 DATA and doesn't pin 13 mean port 1, bit 3??? Anybody??). At the present moment, I don't know why that wasn't a sufficient test indicator. Seems like that should have worked just fine. However, it wasn't until I connected my logic probe to GPIO 06 that I was actually able to make a visible state change on a pin. So far, I've only tried GPIO 0 bit 6.

Another important step is enabling the port like Android_Lin said above. By default, they seem to be disabled or un-configured. I never figured out the "PCI South Bridge" method for configuring ANYTHING. I was however, able to communicate with the PCI configuration registers 0CF8h/0CFCh. I got the vendor ID and Device ID returned in the EAX register and that's where my success with PCI South Bridge ran out. I wrote a very simple program in FDOS DEBUG to handle that, and it's much more read-able than the C method I've seen somewhere.

In the data sheets, you will see multiple times over "BA refers to the register of index 63h, 62h" when trying to formulate an address in PCI land. I never figured out how these vales apply to anything. Is 63h a high and 62h low to form a 16-bit something or other? Are they standard I/O space? Are they memory register locations? Let's just say that the -EX document leaves MUCH to be desired from its readers (at least, one of its readers). Even in Android_Lin's "Step 1" above, he says "access SouthBridge(SB) and set GPIO base address at 62h, 63h" and then no further elaboration.

I did find one effective method of enabling the GPIO hardware was to run "86crsbar.exe A" in the C:\Tools directory. 'A' just means set GPIO 1 to remove focus from the UART and become normal on/off bits. This sets things up "magically" somehow, leaves the GPIO in an enabled state and now you can access GPIO DATA/DIR registers F200h, F202h or F206h, F204h etc...

So after all that, what I have is a DOS-like computer that I can turn on/off GPIO bits or read them back in a high level language ONLY. For whatever reasons that be, my assembly language routines won't report the port reads correctly. This is a TSR routine that I wrote on a 486 laptop and it works flawlessly on that platform reading a printer port pin. I don't know if things happen too fast down low, or what the deal is on the 86Duino, but the port status never changes when read in my TSR. In QBASIC, the port reads and reports pin-state changes just fine.

I guess that'll have to be good enough for now. It's better than what I had before. I own two of these 86Duino ONE boards and have since November, 2018. Couldn't get it off the ground running (or walking, or crawling, or even positioned on its knees and hands), so I put it away for a long time. Finally spent all of last week digging into it again and this is where I am. I want soooo badly to fall in love with this product!! Mostly because it's a cheap PC. I, like the OP Dinosaur, want nothing from it as an Arduino compatible board with clunky libraries. You shouldn't need a 700KB executable to blink an on-board LED! Laugh

John

2020 年 04 月 23 日
13:49:36
Android_Lin
Moderator
Forum Posts: 228
Member Since:
2014 年 04 月 01 日
Offline

Hi, jejump,

Sorry so late to response, I write a sample code with C on 86Duino Vortex86EX, the sample code can be compiled by BC3.0 and it can blink LED on 86Duino and file size is 11KB. Download the sample code and refer : https://drive.google.com/open?id=1n778_aMfWQwMy_YK_i9D-_RdhPOu3t-n

2020 年 04 月 23 日
18:46:13
jejump
Moderator
Forum Posts: 14
Member Since:
2015 年 02 月 22 日
Offline

Android_Lin!!! Good to see you!

Thank you for that code. I'll dig into it this evening (for me right now, it's 5:45 AM) and follow along.

Another note... I fixed the problem I had in my TSR with the 86Duino. It now reads and writes to memory and I/O space shared by QBASIC just fine. LaughLaugh

The problem all along was the guy doing the programming (me) Cry

Now I'll buy a ZERO for this project as this 86Duino ONE board I'm using has a VGA card that would ultimately go wasted for this project. It's been nice to develop on, though.

Forum Timezone: Asia/Taipei

Most Users Ever Online: 229

Currently Online:
2 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

Dinosaur: 27

leutenecker: 13

mrZagg: 10

hippy: 9

smeezekitty: 8

lukeross: 8

tomka: 8

Ekkehard: 8

UIdahoCIT: 8

blaxxun: 7

Member Stats:

Guest Posters: 0

Members: 1578

Moderators: 15

Admins: 5

Forum Stats:

Groups: 2

Forums: 11

Topics: 248

Posts: 1114

Newest Members: DopeFiette, modtra, alan1974, Sergeyfup, mitunsclusa, Dennissot, bb4000, Ovendaanalolymn, Ling ChengYU, EROGurnedo

Moderators: Glaux: 70, uaa: 11, guigra: 17, asian55: 22, Android_Lin: 228, bcarroll: 12, cucubutter: 84, recycled-air: 12, stevemork: 16, zerozaber: 52, pongraczi: 26, jejump: 14, George Andrews III: 56, poto: 11, garpastym: 20

Administrators: eveshih: 1, anthony: 31, viky6: 0, roboard: 135, hcl: 1