We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi, We use a MM167 from Phytec with a C167CS-LM controller. We want to use the Receive Interrupt of the UART. The interrupt-out (open-drain) is connected to Port P2.0 The Tasking Code (works perfectly): DP2_0 = 0; // init direction to input DP2_1 = 0; // init direction to input CCM0 = 0x0022; // UART PORT: CCMOD0 auf 010 setzen // CCMOD1 auf 010 setzen (negativ external transition) CC0IC = 0x0058; // enable interrupt for CC0: //ILVL = 6; GLVL = 0; CC0IE = 1. CC1IC = 0x0054; // enable interrupt for CC1: //ILVL = 5; GLVL = 0; CC0IE = 1. and the interrupts : interrupt (0x10) void UART_r(void) interrupt (0x11) void Port2_1(void) In tasking there are no problems. The interrupt 0x11 also works with the keil-code but the interrupt 0x10 does'nt work. Are there any settings in START167.A66 which disable the interrupt? Or maybe there are some settings in the tasking asm File which are absent in the Keil Version? greetings Michael Martin
With Keil C166 you should write
void UART_r(void) interrupt 0x10 using RB1 void Port2_1(void) interrupt 0x11 using RB2
interrupt (0x10) void UART_r(void) interrupt (0x11) void Port2_1(void)
Thanks for the rapid answer, but... void UART_r(void) interrupt 0x10 using RB1 void Port2_1(void) interrupt 0x11 using RB2 ...of course i used this Code. Interrupt 0x11 works and 0x10 not. That's my problem. I don't know why. interrupt (0x10) void UART_r(void) interrupt (0x11) void Port2_1(void) This was Tasking code and the Keil C166 would output an Error if i would try to compile this code - Michael
The settings for P2.0 and P2.1 in your code are essentially the same. I can't see why one of the interrupts would work and the other wouldn't. Maybe there's another interrupt in the system with the same ILVL and GLVL? Can you have a closer look at what happens? Check if CC0IR gets set, verify that the contents of CCM0, DP2, CC0IC are correct. Are you sure there is a transition on P2.0? To the best of my knowledge, Keil's configuration code doesn't interfere with P2.0 or P2.1, unless you are using Monitor166 in Simulated Serial Mode with P2.0 or P2.1 as serial I/O. Regards, - Mike
Have you tried it in the Keil simulator?