I am a student intern using an Infineon C167CS-l40M mounted on Phytec module phycore 167HSE. I have been using DAvE 2.1 r22 and Keil uvision3 v3.05. I am developing SW that will generate a PEC transfer on the negative clock edge to grab data one byte at a time from a memory location and send it out parallel port 2. I am generating the clock from T3OUT (P3.3) using GPT1 timer 3 in timer mode, reloaded from timer 4. This clock is then fed back into CC23IO (P8.7). The reason for this setup is that I will eventually be using this clock to time events on multiple controllers, but for now just testing it on one controller. Anyway, CAPCOM channel 23 is configured to capture the negative clock edge and initiate a PEC transfer that will move consecutive bytes of data from adjacent memory locations to be output through port 2. So far, the clock signal looks good on the scope, so that part of the code is working, but the CAPCOM interrupt is not being invoked, there is no PEC transfer, and when I go into debug mode and single step the program, it gets hung up and crashes right at the line P3 = 0x0000 in the IO.C file. I have included some of the code below, if anyone has any thoughts please post. Thanks! Dave from main.c
void Send_One_Shot(void) { msg_size = 3; tx_buffer[0] = 0xF1; // Node tx_buffer[1] = 0x06; // Command tx_buffer[2] = 0x01; // Parameter tx_buffer[3] = Checksum(msg_size); PECC0 = 0x0504; }
ODP3 = 0x0000; // load open-drain register P3 = 0x0000; // load data register POCON3 = 0x0000; // load output control register DP3 = 0x0000; // load direction register
P3 = (P3 & ~(uword)0x0008) | 0x0008; //set data register DP3 = (DP3 & ~(uword)0x0008) | 0x0008; //set direction register
PECC0 = 0x0501; // load PECC0 control register SRCP0 = _sof_(tx_buffer); // Point PEC data source pointer back to start of table DSTP0 = (int)(&P2); // PEC destination port 2