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 ---------------------------------------------- PD9 = 0x00; //PROTECT OFF PRCR = 0x07; // S3 Control Register S3C = 0xA3; //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; //Interrupt cause select register: select SI/O3 IFSR = 0x00; //reset Interrupt request bit for SI/O3 S3IC &= ~(1<<3); //PROTECT ON PRCR = 0x00; __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) { //save S3TRR content in daten Array daten[data_counter] = S3TRR; //increment counter data_counter++; //reset Interrupt Request bit to 0 S3IC &= ~(1<<3); }