void sio3_init(void) { __disable_interrupt(); /*------------------------------------------------------------------------\ | SI/O3 Control register (protect off before writing to this register) | |//Sout3 output, Input-output-port, MSB first, external clock, high output| \------------------------------------------------------------------------*/ // setting up configuration ---------------------------------------------- //PROTECT OFF PRCR = 7; S3C |= 0xA0; //S3BRG must not be set, Transfer Bitrate is determined by ext. clk from ECK Chip ! //Interrupt control register (polarity select bit: rising edge, Interrupt Level 6) S3IC |= 0x16; S3IC &= 0xDE; //in Interrupt cause select register: select SI/O3 IFSR &= 0xBF0; //reset Interrupt request bit for SI/O3 S3IC &= 0xF7; //PROTECT ON PRCR = 0x00; puts("SI/O3 initialized.\n"); __enable_interrupt(); } /*------------------------------------------------------------------------ SIO3 ISR added/changed by Simon Bauernfeind Interrupt Request Bit in S3IC is set by the rising edge of last transfer clock ! ----------------------------------------------------------------------*/ #pragma vector = SIO3 __interrupt void sio3_handler(void) { //only for testing printf("SIO3 int %d\n", data_counter); //save S3TRR content in daten Array daten[data_counter] = S3TRR; //increment counter data_counter++; //reset Interrupt Request bit to 0 S3IC &= ~(1<<3); }