Hi
Pwm Channel3 (AVR MEGA8) works in software but does not work on the chip.
Please advise.
PWM Channel 3 does not work
Moderator: Benj
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: PWM Channel 3 does not work
Hello,
Sorry for the delay. I'm investigating for you now. I've now had a good check through the code and the device datasheet and it all looks ok.
As a test if you enable timer 2 interrupt does this allow the PWM to function?
Sorry for the delay. I'm investigating for you now. I've now had a good check through the code and the device datasheet and it all looks ok.
As a test if you enable timer 2 interrupt does this allow the PWM to function?
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: PWM Channel 3 does not work
Hello,
Just add an interrupt icon, set the type to enable timer 2 and configure the prescaler and other properties as desired. Hopefully this should kick start the PWM but let me know how you get on.
Just add an interrupt icon, set the type to enable timer 2 and configure the prescaler and other properties as desired. Hopefully this should kick start the PWM but let me know how you get on.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Re: PWM Channel 3 does not work
Hello Benj
The method you provided didn't work.
The software makes an error when compiling.
In file included from C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\includes.c:647,
from C:\Users\RAB\Desktop\check\Z\Flowcode1.c:351:
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\/AVR\AVR_CAL_PWM.c:179:6: warning: #warning "PWM Channel Uses Resource Timer 1"
In file included from C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\includes.c:669,
from C:\Users\RAB\Desktop\check\Z\Flowcode1.c:351:
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\/AVR\AVR_CAL_PWM.c:179:6: warning: #warning "PWM Channel Uses Resource Timer 1"
In file included from C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\includes.c:692,
from C:\Users\RAB\Desktop\check\Z\Flowcode1.c:351:
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\/AVR\AVR_CAL_PWM.c:238:7: warning: #warning "PWM Channel Uses Resource Timer 2"
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\/AVR\AVR_CAL_PWM.c:495:3: warning: #warning "Period control register not available on target device, period will default to 255 + 1"
C:\Users\RAB\Desktop\check\Z\Flowcode1.c: In function 'main':
C:\Users\RAB\Desktop\check\Z\Flowcode1.c:939: error: 'TCCR2B' undeclared (first use in this function)
C:\Users\RAB\Desktop\check\Z\Flowcode1.c:939: error: (Each undeclared identifier is reported only once
C:\Users\RAB\Desktop\check\Z\Flowcode1.c:939: error: for each function it appears in.)
Error returned from [avr-gcc.exe]
C:\Program Files (x86)\Flowcode\Common\Compilers\avr\batchfiles\avra.bat reported error code 1
The method you provided didn't work.
The software makes an error when compiling.
In file included from C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\includes.c:647,
from C:\Users\RAB\Desktop\check\Z\Flowcode1.c:351:
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\/AVR\AVR_CAL_PWM.c:179:6: warning: #warning "PWM Channel Uses Resource Timer 1"
In file included from C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\includes.c:669,
from C:\Users\RAB\Desktop\check\Z\Flowcode1.c:351:
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\/AVR\AVR_CAL_PWM.c:179:6: warning: #warning "PWM Channel Uses Resource Timer 1"
In file included from C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\includes.c:692,
from C:\Users\RAB\Desktop\check\Z\Flowcode1.c:351:
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\/AVR\AVR_CAL_PWM.c:238:7: warning: #warning "PWM Channel Uses Resource Timer 2"
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\/AVR\AVR_CAL_PWM.c:495:3: warning: #warning "Period control register not available on target device, period will default to 255 + 1"
C:\Users\RAB\Desktop\check\Z\Flowcode1.c: In function 'main':
C:\Users\RAB\Desktop\check\Z\Flowcode1.c:939: error: 'TCCR2B' undeclared (first use in this function)
C:\Users\RAB\Desktop\check\Z\Flowcode1.c:939: error: (Each undeclared identifier is reported only once
C:\Users\RAB\Desktop\check\Z\Flowcode1.c:939: error: for each function it appears in.)
Error returned from [avr-gcc.exe]
C:\Program Files (x86)\Flowcode\Common\Compilers\avr\batchfiles\avra.bat reported error code 1
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: PWM Channel 3 does not work
Hello,
Sorry for the delay, I've now pushed updates to the update system to allow the timer2 interrupt to compile correctly. This gives me a clue as to the PWM issue too so I'll see if I can get this resolved too so you dont have to add the interrupt icon.
Sorry for the delay, I've now pushed updates to the update system to allow the timer2 interrupt to compile correctly. This gives me a clue as to the PWM issue too so I'll see if I can get this resolved too so you dont have to add the interrupt icon.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel