If I try to use
PWM16bit_Init(_PWM16_PHASE_CORRECT_MODE_8BIT, _PWM16_PRESCALER_16bit_8, _PWM16_NON_INVERTED, 0, _TIMER1);
PWM16bit_Enable(_PWM16_NON_INVERTED, _PWM16_TIMER1_CH_A ); after initializing I got
"229 303 Identifier "PWM16bit_Enable" was not declared SUN2000_Slave.mpas"
Doesn't the Atmega32 have a 16Bit PWm?
PWM16bit_Enable with Atmega32 not exists?
Re: PWM16bit_Enable with Atmega32 not exists?
Found an Mikroe Failure.
The correct parameter ist
PWM16bit_Change_Duty(100, _TIMER1_CH_A );
NOT
PWM16bit_Set_Duty(100, _TIMER1_CH_A );
The correct parameter ist
PWM16bit_Change_Duty(100, _TIMER1_CH_A );
NOT
PWM16bit_Set_Duty(100, _TIMER1_CH_A );
-
- Posts: 158
- Joined: 24 May 2008 15:55
- Location: Germany
Re: PWM16bit_Enable with Atmega32 not exists?
I think there is no pwm16bit_enable function
one of the MIKROE miracles
you can start the pwm with:
PWM16bit_Start( _TIMER1 ) ' Starts the PWM-16bit module on Timer/Counter1
one of the MIKROE miracles
you can start the pwm with:
PWM16bit_Start( _TIMER1 ) ' Starts the PWM-16bit module on Timer/Counter1
Re: PWM16bit_Enable with Atmega32 not exists?
This example doesn't work too..
DDB1_bit = 1; // set PORTB pin 1 as output for the PWM-16bit
"28 304 Syntax error: Expected ":" but "=" found SUN.mpas"
????
DDB1_bit = 1; // set PORTB pin 1 as output for the PWM-16bit
"28 304 Syntax error: Expected ":" but "=" found SUN.mpas"
????
Re: PWM16bit_Enable with Atmega32 not exists?
@Thomas.Pahl@t-online.de
PWM Start makes no difference.
It works now, but only up to 255 and then it starts again from the beginning, so it runs only with 8 bits
I use the Atmeg3216PU and Portd.5
PWM Start makes no difference.
It works now, but only up to 255 and then it starts again from the beginning, so it runs only with 8 bits
I use the Atmeg3216PU and Portd.5
-
- Posts: 158
- Joined: 24 May 2008 15:55
- Location: Germany
Re: PWM16bit_Enable with Atmega32 not exists?
You are right, but if you use pwm_start you do not need to remember if pwm was stopped before.
-
- Posts: 161
- Joined: 14 Mar 2016 10:24
- Contact:
Re: PWM16bit_Enable with Atmega32 not exists?
Hi,Thomas.Pahl@t-online.de wrote: ↑20 Jul 2022 18:58I think there is no pwm16bit_enable function
one of the MIKROE miracles
you can start the pwm with:
PWM16bit_Start( _TIMER1 ) ' Starts the PWM-16bit module on Timer/Counter1
have been working with PWM a while back.
First I used the mikroE commands, like you wrote above.
Later I dove in to the microcontroller itself and did the whole PWM 'thing' myself.
You have to work the different bits in the registers who do control the different PWM's.
Here you see me playing with PWM:
https://www.youtube.com/watch?v=GEHB-jT ... cT&index=4
https://www.youtube.com/watch?v=Yh4kQxe ... cT&index=5
The pc I've coded in Lazarus, the Arduino 2560 in mikroPascal/AVR.
Took a quick look at the Atmega32 'pwm':
Kind regards
To DIY or not to DIY
Re: PWM16bit_Enable with Atmega32 not exists?
Which window manager do you use under Lazarus?
It looks good
It looks good
-
- Posts: 161
- Joined: 14 Mar 2016 10:24
- Contact:
Re: PWM16bit_Enable with Atmega32 not exists?
I'm sorry. I don't understand your question. What do you mean?
Kind regards. Marcel.
To DIY or not to DIY