System Installation
PEB-2738I User’s Manual
3-5
3.7 GPIO
The PEB-2738 provides 8 programmable input or output ports that can be
individually configured to perform a simple basic I/O function. Users can configure
each individual port to become an input or output port by programming register bit
of I/O Selection. To invert port value, the setting of Inversion Register has to be
made. Port values can be set to read or write through Data Register.
The GPIO ports are located on J12 shown as follows.
Notes :
Do not short-circuit Pin 9 and 10 of J11
!
3.8 WDT/GPIO
Assembly
Code
#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
void WDT_Enable(int time,int mode);
void WDT_Disable();
void GPIO_Set_Mode(int bit,int mode);
void GPIO_Write(int bit,int data);
int GPIO_Read(int bit);
void main(){
outp (0x2e,0x87);//Input SIO entry key
outp
(0x2e,0x87);
//WDT sample code
WDT_Enable(20,0);
//WDT_Disable();
//GPIO sampe code
GPIO_Set_Mode(0,0);//set GPIO 30 for output
GPIO_Set_Mode(1,1);//set GPIO 31 for input
GPIO_Set_Mode(2,1);//Set GPIO 32 for input
GPIO_Write(0,1);//Set GPIO 30 for high
outp (0x2e,0xAA);//Input SIO Exit key