Page 1 of 1

Regolazione più fine del duty cycle

PostPosted: 20 May 2019, 10:56
by tnnbascom
Salve,
come posso fare, ad avere degli incrementi di valore di duty cycle minori ? (Cioè una regolazione più fine del duty cycle...)

Il codice che sto usando è il seguente:

Code: Select all
$regfile = "m1284Pdef.dat"
$crystal = 16000000
$baud = 19200
$hwstack = 48
$swstack = 24
$framesize = 48

Dim Dutycycle_tmp As Byte

Tccr2a = &B00100011
Tccr2b = &B00001010                                         'Prescaler 8

Ocr2a = Dutycycle_tmp

Pwm2b = 40                                                  '40KHZ

Re: Regolazione più fine del duty cycle

PostPosted: 21 May 2019, 09:26
by tnnbascom
Mi scuso questo è il codice corretto con frequenza fissa 40Khz:

Code: Select all
Tccr2a = &B00100011
Tccr2b = &B00001010                                         'Prescaler 8
Ocr2a = 49                                                  '40KHZ
Pwm2b = Pwr_pwm_tmp


e impostando PWR_PWM_TMP=24, ho questo segnale:

TEK0001.jpg
TEK0001.jpg (37.86 KiB) Viewed 3058 times


Ho quindi 48 step...

come posso aumentare il numero di passi?

Re: Regolazione più fine del duty cycle

PostPosted: 07 Feb 2020, 22:03
by Steeve42
tnnbascom wrote:Salve,
come posso fare, ad avere degli incrementi di valore di duty cycle minori ? (Cioè una regolazione più fine del duty cycle...)
paris shuttle airport transfers
Il codice che sto usando è il seguente:

Code: Select all
$regfile = "m1284Pdef.dat"
$crystal = 16000000
$baud = 19200
$hwstack = 48
$swstack = 24
$framesize = 48

Dim Dutycycle_tmp As Byte

Tccr2a = &B00100011
Tccr2b = &B00001010                                         'Prescaler 8

Ocr2a = Dutycycle_tmp

Pwm2b = 40                                                  '40KHZ

What's this?