Sundance SMT326v2 User Manual
Page 16

Release
Page 16 of 24
SMT326 DSP PC/ISA System User Guide
Document Name:
SMT326 Ugv2.doc
Original Date: 08/11/97
Product Name:
SMT326
Revision Date: 08/26/99
Author:
Graeme Parker – Fabio Ancona
i2c_send_address(0x22,0);
i2c_write(1);
i2c_write(0x00);
i2c_stop();
i2c_send_address(0x22,0);
i2c_write(2);
i2c_write(0x00);
i2c_stop();
i2c_send_address(0x22,0);
i2c_write(3);
i2c_write( 00);
i2c_stop();
i2c_send_address(0x22,0);
i2c_write(4);
i2c_write( 00);
i2c_stop();
ctrl_byte=0x89;
i2c_send_address(0x22,0);
i2c_write(5);
i2c_write(ctrl_byte);
i2c_stop();
i2c_send_address(0x22,0);
i2c_write(0x80);
i2c_restart(0x23,0);
for(delay=0;delay!=175;delay++);
temp=*i2c_sn; /* discard 1st byte */
for(delay=0;delay!=175;delay++);
temp=i2c_read(1);
for(delay=0;delay!=175;delay++);
i2c_stop();
}
/* Generate IACK */
asm(" push ar0 ");
asm(" ldhi 7000h,ar0 ");
asm(" iack *ar0 ");
asm(" pop ar0 ");
j=0;
fpga =(unsigned long *)0x80200000;
status=(unsigned long *)0x80200020;
printf("\n\nEnter input channel number.\n");
printf("Output will appear on that output channel\n");
scanf("%d",&channel);
if (channel>15){