beautypg.com

Appendix d

Page 55

background image

HS-874P User’s Manual Programming GPIO’s

Programming GPIO’s

55

Appendix D

The GPIO can be programmed with the MSDOS debug program using simple

IN/OUT commands. The following lines show an example how to do this.

GPIO0...GPIO7 bit0……bit7

-o 2E 87 ;enter configuration

-o 2E 87

-o 2E 2A

-o 2F FD ;enable GPIO function

-o 2E 07

-o 2F 07 ;enable GPIO configuration

-o 2E F0

-o 2F xx ;set GPIO as input/output; set ‘1’ for input,’0’for output

-o 2E F1

-o 2F xx ;if set GPIO’s as output, in this register its value can be set

Optional :

-o 2E F2

-o 2F xx ; Data inversion register ; ‘1’ inverts the current value of the bits ,’0’

leaves them as they are

-o 2E 30

-o 2F 01 ; active GPIO’s

For further information, please refer to Winbond W83627DHG datasheet.