<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: MC68HC908QL4: PWM doesn't work together with any CHxIE enabled! in 8-bit Microcontrollers</title>
    <link>https://community.nxp.com/t5/8-bit-Microcontrollers/MC68HC908QL4-PWM-doesn-t-work-together-with-any-CHxIE-enabled/m-p/124478#M332</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Hi David,&lt;BR /&gt;&lt;BR /&gt;Yes, I reset this interrupt flag in my ISR, but the problem is that the ISR is never called! &lt;BR /&gt;I have anyway located the problem - it lies probably in CodeWarrior compiler. Namely there is a file called vector.c, where the interrupt vector is defined and I thought I should set the appropriate element of the vector to my ISR, and so I did but it didn't work as I written before. I just looked at the memory dump and there was just 0xFFFF in the place where the ISR address should be. &lt;BR /&gt;But I have found also another place where the user can (and should) set his ISR address, and it is a project file called "Project.prm". There is a command to use called "VECTOR" with parameters like ISR position (address) and ISR name. Than the program is correctly compiled and the memory is correctly filled with the ISR address.&lt;BR /&gt;Well, then my question is: why do we want this funny vector.c file since it makes just nothing to the program? I have removed the ISR entry from it and replaced with NULL and left only VECTOR entry in project.prm and it worked also good, like before!&lt;BR /&gt;&lt;BR /&gt;Best regards,&lt;BR /&gt;Yac.&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 19 Jul 2006 17:35:55 GMT</pubDate>
    <dc:creator>Yac</dc:creator>
    <dc:date>2006-07-19T17:35:55Z</dc:date>
    <item>
      <title>MC68HC908QL4: PWM doesn't work together with any CHxIE enabled!</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/MC68HC908QL4-PWM-doesn-t-work-together-with-any-CHxIE-enabled/m-p/124474#M328</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello everybody,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've got a problem with PWM - it doesn't work when I enable timer interrupts.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I have just programmed the PWM on the channel 0, and I wanted to have an ISR to be called when output compare occurs on channel 1.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I have done the following steps:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1. Define an ISR function: it just resets the timer channel flag.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#pragma TRAP_PROC&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;void TIM_ISR(void)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;TSC1; // read TIM channel status and control&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;TSC1_CH1F = 0; // clear timer channel flag&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;2. Add this ISR function to the interrupt vector:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;void *const _vectab[] =&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LIN_VECTF NULL, /* 0xFFDE ADC */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LIN_VECTF NULL, /* 0xFFE0 Keyboard */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LIN_VECTF NULL, /* 0xFFE2 Reserved */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LIN_VECTF NULL, /* 0xFFE4 Reserved */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LIN_VECTF NULL, /* 0xFFE6 Reserved */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LIN_VECTF NULL, /* 0xFFE8 Reserved */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LIN_VECTF SLIC_ISR, /* 0xFFEA SLIC */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LIN_VECTF NULL, /* 0xFFEC Reserved */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LIN_VECTF NULL, /* 0xFFEE Reserved */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LIN_VECTF NULL, /* 0xFFF0 Reserved */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LIN_VECTF NULL, /* 0xFFF2 TIMER overflow */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LIN_VECTF TIM_ISR, /* 0xFFF4 TIMER channel 1 */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LIN_VECTF NULL, /* 0xFFF6 TIMER channel 0 */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LIN_VECTF NULL, /* 0xFFF8 Reserved */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LIN_VECTF NULL, /* 0xFFFA IRQ */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LIN_VECTF NULL, /* 0xFFFC SWI */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LIN_VECTF _Startup /* 0xFFFE RESET */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;};&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;3. Enable the interrupt in the main function:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;TSC1_CH1IE = 1;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When the interrupt from channel 1 isn't enabled, the PWM based upon the channel 0 works correctly, but as soon as I enable this interrupt then the whole PWM stops working.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;What do I wrong? Maybe should I do some additional things in ISR?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;TIA,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Yac.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Jul 2006 12:39:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/MC68HC908QL4-PWM-doesn-t-work-together-with-any-CHxIE-enabled/m-p/124474#M328</guid>
      <dc:creator>Yac</dc:creator>
      <dc:date>2006-07-19T12:39:40Z</dc:date>
    </item>
    <item>
      <title>Re: MC68HC908QL4: PWM doesn't work together with any CHxIE enabled!</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/MC68HC908QL4-PWM-doesn-t-work-together-with-any-CHxIE-enabled/m-p/124475#M329</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;FONT size="2"&gt;Hello Yac,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;Are you using bufferered or unbuffered PWM.&amp;nbsp; I am not sure about the 908QL4, but for other devices that use the TIM, when buffered PWM is used, timer channels 0 and 1 are linked.&amp;nbsp; I wonder if this is the problem you are observing.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;Regards,&lt;BR /&gt;Mac&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Jul 2006 13:48:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/MC68HC908QL4-PWM-doesn-t-work-together-with-any-CHxIE-enabled/m-p/124475#M329</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2006-07-19T13:48:05Z</dc:date>
    </item>
    <item>
      <title>Re: MC68HC908QL4: PWM doesn't work together with any CHxIE enabled!</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/MC68HC908QL4-PWM-doesn-t-work-together-with-any-CHxIE-enabled/m-p/124476#M330</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Hi Mac,&lt;BR /&gt;I am just using the unbuffered PWM. I have done some tests in meantime and I have noticed that the main code of program doesn't work when I enable the CHxIE interrupt, this means, that I have a simple test loop in main() that do practically nothing but looping, and when the CHxIE is disabled then the LED on PCB shines a little bit accordingly to low duty cycle, and program runs correctly in loop, but when I set the CHxIE as enabled, then the program goes to loop, makes maybe 1-2 iterations under debugger and then goes to strange place where all memory addresses are filled with 0xCDCD, and additionally I have an error message: "Last RESET caused by Illegal opcode executed.".&lt;BR /&gt;I think this problem is connected with ISR function. Maybe the microcontroller doesn't know that I have already defined the ISR for Timer? But it's strange, since I have set the address of ISR to interrupt vector and also the ISR function is defined and it should be simply called and returned from it.&lt;BR /&gt;&lt;BR /&gt;Best regards,&lt;BR /&gt;Yac.&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Jul 2006 14:39:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/MC68HC908QL4-PWM-doesn-t-work-together-with-any-CHxIE-enabled/m-p/124476#M330</guid>
      <dc:creator>Yac</dc:creator>
      <dc:date>2006-07-19T14:39:06Z</dc:date>
    </item>
    <item>
      <title>Re: MC68HC908QL4: PWM doesn't work together with any CHxIE enabled!</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/MC68HC908QL4-PWM-doesn-t-work-together-with-any-CHxIE-enabled/m-p/124477#M331</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;P&gt;Hi Yac,&lt;/P&gt;&lt;P&gt;Just a thought. Does your ISR compile into code that satisfies the requirements to clear the interrupt flag?&lt;/P&gt;&lt;P&gt;Regards David&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Jul 2006 17:02:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/MC68HC908QL4-PWM-doesn-t-work-together-with-any-CHxIE-enabled/m-p/124477#M331</guid>
      <dc:creator>peg</dc:creator>
      <dc:date>2006-07-19T17:02:02Z</dc:date>
    </item>
    <item>
      <title>Re: MC68HC908QL4: PWM doesn't work together with any CHxIE enabled!</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/MC68HC908QL4-PWM-doesn-t-work-together-with-any-CHxIE-enabled/m-p/124478#M332</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Hi David,&lt;BR /&gt;&lt;BR /&gt;Yes, I reset this interrupt flag in my ISR, but the problem is that the ISR is never called! &lt;BR /&gt;I have anyway located the problem - it lies probably in CodeWarrior compiler. Namely there is a file called vector.c, where the interrupt vector is defined and I thought I should set the appropriate element of the vector to my ISR, and so I did but it didn't work as I written before. I just looked at the memory dump and there was just 0xFFFF in the place where the ISR address should be. &lt;BR /&gt;But I have found also another place where the user can (and should) set his ISR address, and it is a project file called "Project.prm". There is a command to use called "VECTOR" with parameters like ISR position (address) and ISR name. Than the program is correctly compiled and the memory is correctly filled with the ISR address.&lt;BR /&gt;Well, then my question is: why do we want this funny vector.c file since it makes just nothing to the program? I have removed the ISR entry from it and replaced with NULL and left only VECTOR entry in project.prm and it worked also good, like before!&lt;BR /&gt;&lt;BR /&gt;Best regards,&lt;BR /&gt;Yac.&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Jul 2006 17:35:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/MC68HC908QL4-PWM-doesn-t-work-together-with-any-CHxIE-enabled/m-p/124478#M332</guid>
      <dc:creator>Yac</dc:creator>
      <dc:date>2006-07-19T17:35:55Z</dc:date>
    </item>
  </channel>
</rss>

