EasyManuals Logo

C&T PC400 Series User Manual

Default Icon
71 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #70 background imageLoading...
Page #70 background image
PC400 / PC410 l User’s Manual
70
Sample Code:
#1 :
// Get GPI 1 status
//Get GPI 0 Pin Status Register
printf("Input port value = %x\n", ReadByte(GPI1to4_ADDR)); // bit4 = GPI 1 status
// Get GPI 5 status
//Get GPI 0 Pin Status Register
printf("Input port value = %x\n", ReadByte(GPI_REG5to8)); // bit0 = GPI 5 status
#2 :
// Set GPO status to high
; Set GPO 1 Pin to High
Data = ReadByte(GPO1to4_ADDR) | GPO1_DataHigh;
WriteByte(GPO1to4_ADDR, Data); //Set IO_DO1 to High
; Set GPO 2 Pin to High
Data = ReadByte(GPO1to4_ADDR) | GPO2_DataHigh;
WriteByte(GPO1to4_ADDR, Data); //Set IO_DO2 to High
; Set GPO 3 Pin to High
Data = ReadByte(GPO1to4_ADDR) | GPO3_DataHigh;
WriteByte(GPO1to4_ADDR, Data); //Set IO_DO3 to High
; Set GPO 4 Pin to High
Data = ReadByte(GPO1to4_ADDR) | GPO4_DataHigh;
WriteByte(GPO1to4_ADDR, Data); //Set IO_DO4 to High
; Set GPO 5 Pin to High
Data = ReadByte(GPO5_ADDR) | GPO5_DataHigh;
WriteByte(GPO5_ADDR, Data); //Set IO_DO5 to High
; Set GPO 6 Pin to High
Data = ReadByte(GPO6_ADDR) | GPO6_DataHigh;
WriteByte(GPO6_ADDR, Data); //Set IO_DO6 to High
; Set GPO 7 Pin to High
Data = ReadByte(GPO7_ADDR) | GPO7_DataHigh;
WriteByte(GPO7_ADDR, Data); //Set IO_DO7 to High
; Set GPO 8 Pin to High
Data = ReadByte(GPO8_ADDR) | GPO8_DataHigh;
WriteByte(GPO8_ADDR, Data); //Set IO_DO8 to High
Appendix WDT & GPIO

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the C&T PC400 Series and is the answer not in the manual?

C&T PC400 Series Specifications

General IconGeneral
BrandC&T
ModelPC400 Series
CategoryControl Unit
LanguageEnglish