background image

110425 

 

 

 

OPERATIONS MANUAL PCM-UIO48B 

 

 

 

 

24

 

}

 

/* Clean up the screen for our display. Nothing fancy */

 

clrscr();

 

for(x=1; x<25; x++)

 

{

 

 

gotoxy(1,x);

 

 

printf(“Bit number %02d “,x);

 

}

 

/* We will continue to display until any key is pressed */

 

while(!kbhit())

 

{

 

 

/* Retrieve any pending transitions and update the counts */

 

 

check_ints();

 

 

/* Display the current count values */

 

 

for(x=1; x < 25; x++)

 

 

{

 

 

 

gotoxy(16,x);

 

 

 

printf(“%05u”,int_counts[x]);

 

 

}

 

}

 

getch();

}

void check_ints()

{

int current;

 

/* Get the bit number of a pending transition interrupt */

 

current = get_int();

 

/* If it’s 0 there are none pending */

 

if(current == 0)

 

 

return;

 

/* Clear and rearm this one so we can get it again */

 

clr_int(current);

 

/* Tally a transition for this bit */

 

++int_counts[current];

}

 

Summary of Contents for PCM-UIO48B

Page 1: ...the WinSystems website If this manual or any portion of the manual is downloaded copied or emailed the links to additional information i e software cable drawings may be inoperable WinSystems reserves...

Page 2: ...REVISION HISTORY P N 403 0321 000 ECO Number Date Code Rev Level ORIGINATED 110425 A...

Page 3: ...cription 1 Functional Capability 2 I O Address Selection 2 Interrupt Routing 2 Digital I O 3 PC 104 Bus Interface 4 Software Summary 5 WS16C48 Programming Reference 7 Sample Programs 11 Summary 11 C S...

Page 4: ...connector and jumper configuration data J1 Ports 3 5 I O Connector J2 Ports 0 2 I O Connector J6 Auxillary Interrupt Routing Header J5 PC 104 Bus 8 bit 16 bit Connector J3 Base I O Address Selection J...

Page 5: ...upt service routine can quickly determine through a series of interrupt identification registers the exact port s and bit s which have transitioned The PCM UIO48B utilizes WinSystems WS16C48 ASIC High...

Page 6: ...Selection Interrupt Routing The PCM UIO48B can generate an interrupt on up to 24 different lines each with its own polarity select Interrupt support is provided on the first 24 bits of each device fo...

Page 7: ...7 o o 8 9 o o 10 11 o o 12 13 o o 14 15 o o 16 17 o o 18 19 o o 20 21 o o 22 23 o o 24 25 o o 26 27 o o 28 29 o o 30 31 o o 32 33 o o 34 35 o o 36 37 o o 38 39 o o 40 41 o o 42 43 o o 44 45 o o 46 47...

Page 8: ...5 KEY A1 o o B1 A2 o o B2 A3 o o B2 A4 o o B4 A5 o o B5 A6 o o B6 A7 o o B7 A8 o o B8 A9 o o B9 A10 o o B10 A11 o o B11 A12 o o B12 A13 o o B13 A14 o o B14 A15 o o B15 A16 o o B16 A17 o o B17 A18 o o...

Page 9: ...T_ID0 through INT_ID2 registers When any of the lower three bits are set it indicates that an interrupt is pending on the I O port corresponding to the bit position s that are set Reading this registe...

Page 10: ...tion interrupts When set to a 1 the edge detection interrupt is enabled for the corresponding port and bit When cleared to 0 the bit s edge detection interrupt is disabled Note that this register can...

Page 11: ...ll of the functions utilize the concept of bit_number The bit_number is a value from 1 to 48 1 to 24 for interrupt related functions that correlates to a specific I O pin Bit_number 1 is port 0 bit 0...

Page 12: ..._bit int bit_number Description This function takes a single argument bit_number a value from 1 to 48 specifying the I O pin to be set This function sets the specified I O port bit Note that setting a...

Page 13: ...the specified polarity It does not unmask the interrupt controller install vectors or handle interrupts when they occur There is no return value and only the specified bit is affected DISAB_INT Disabl...

Page 14: ...t in its interrupt being enabled with an undefined polarity Calling this function with no interrupt pending will have no adverse effect Only the specified bit is affected GET_INT Retrieves bit number...

Page 15: ...uio48 c This program illustrates additional features of thw WS16C48 and the I O library functions It programs the first 24 bits for input arms them for falling edge detection and then polls using the...

Page 16: ...other warranty is expressed or implied In no case shall WinSystems be liable for any direct or indirect loss or damage real or consequential resulting from the usage of this source code It is the user...

Page 17: ...iable for any direct or indirect loss or damage real or consequential resulting from the usage of this source code It is the user s sole responsibility to determine fitness for any considered purpose...

Page 18: ...t_images x 0 Set page 2 access for interrupt enables outportb base_port 7 0x80 Clear all interrupt enables outportb base_port 8 0 outportb base_port 9 0 outportb base_port 0x0a 0 Restore normal page 0...

Page 19: ...e I O pin to access is specified by bit_number 1 to 48 val The setting for the specified bit either 1 or 0 This function sets the specified I O pin to either high or low as dictated by the val argumen...

Page 20: ..._images bit_number 8 temp Now actually update the port Only the specified bit is affected outportb port temp SET_BIT This function takes a single argument bit_number The bit number to set This functio...

Page 21: ...igned temp unsigned mask Adjust for 0 based numbering bit_number Calculate the I O address based uppon the bit number port bit_number 8 base_port 8 Calculate a bit mask based on the specified bit numb...

Page 22: ...unsigned port unsigned temp unsigned mask Adjust the bit_number for 0 based numbering bit_number Calculate the I O Address for the enable port port bit_number 8 base_port 8 Calculate the proper bit ma...

Page 23: ...numbering bit_number Calculate the correct I O address for our enable register port bit_number 8 base_port 8 Calculate a bit mask for this bit number mask 1 bit_number 8 Set access to page 2 for the e...

Page 24: ...t x read the master interrupt pending register mask off undefined bits temp inportb base_port 6 0x07 If there are no interrupts pending return a 0 if temp 7 0 return 0 There is something pending now w...

Page 25: ...ly read status of port 2 int id temp inportb base_port 0x0a Read port 2 status If any pending return the appropriate bit number if temp 0 for x 0 x 7 x if temp 1 x outportb base_port 7 0 Turn off acce...

Page 26: ...al or consequential resulting from the usage of this source code It is the user s sole responsibility to determine fitness for any considered purpose include stdio h include conio h include dos h incl...

Page 27: ...direct or indirect loss or damage real or consequential resulting from the usage of this source code It is the user s sole responsibility to determine fitness for any considered purpose include stdio...

Page 28: ...eve any pending transitions and update the counts check_ints Display the current count values for x 1 x 25 x gotoxy 16 x printf 05u int_counts x getch void check_ints int current Get the bit number of...

Page 29: ...ce code It is the user s sole responsibility to determine fitness for any considered purpose include stdio h include dos h include conio h include uio48 h define BASE_PORT 0x120 This program like the...

Page 30: ...interrupts enable Set up the display clrscr Clear the Text Screen for x 1 x 25 x gotoxy 1 x printf Bit Number 02d x We will continuously print the transition totals until a key is pressed All of the p...

Page 31: ...e or we shouldn t even be executing this function current get_int We will continue processing pending edge detect interrupts until there are no more present In which case current 0 while current Clear...

Page 32: ...for models PCM UIO48B 16 CBL 129 4 4 ft ribbon cable 50 pin Both ends with 50 pin socket termination Only available for models PCM UIO48B 16 Examples For WS16C48 Digital I O Chip Linux Drivers Kernel...

Page 33: ...nector J3 Base I O Address Selection Jumper J4 Interrupt Routing Header NOTE The reference line to each component part has been drawn to Pin 1 where applicable Pin 1 is also highlighted with a red squ...

Page 34: ...D GND GND GND GND GND GND GND GND GND GND GND GND GND GND GND J2 1 o o 2 3 o o 4 5 o o 6 7 o o 8 9 o o 10 11 o o 12 13 o o 14 15 o o 16 17 o o 18 19 o o 20 21 o o 22 23 o o 24 25 o o 26 27 o o 28 29 o...

Page 35: ...ERATIONS MANUAL PCM UIO48B 31 I O Address Selection A11 A10 A9 A8 A7 A6 A5 A4 J3 I O Base Address Select jumper J3 shown jumpered for 200H 1 o o 2 3 o o 4 5 o o 6 7 o o 8 9 o o 10 11 o o 12 13 o o 14...

Page 36: ...ddress Each board uses 16 consecutive I O addresses Mechanical Dimensions 3 6 X 3 8 90 mm x 96 mm PC Board FR 4 Epoxy glass with 2 signal layers 2 power planes screened component legend and plated thr...

Page 37: ...insurance charges for any repaired or replaced Products or Software thereafter delivered to Customer within the United States All fees and costs for shipment outside of the United States shall be paid...

Reviews: