News:

PROTON pic BASIC Compilers for PIC, PIC24, dsPIC33

Main Menu

3. hpwm problem

Started by eozkantar, Jul 01, 2023, 05:47 PM

Previous topic - Next topic

eozkantar

selam arkadaşlar
12F1572 ile  hpwm ile  2 çıkışlı hpwm yaparsam normal ama   3 çıkışlı hpwm  yaparsam aşğıdaki uyarıyı alıyorum derleyicide mi problem var ?

device does not contein enough HPWM channels for this declare, it only contains 2 channels


kod
Declare CCP1_Pin PORTA.1    ' Select HPWM port and bit for PWM 1 module (ch 1)
Declare CCP2_Pin PORTA.0  ' ' Select HPWM port and bit for PWM 2 module (ch 2)
Declare CCP3_Pin PORTA.2  ' ' Select HPWM port and bit for PWM 3 module (ch 3)


 Do
         HPWM 1 , 32  ,1000
         HPWM 2 , 200 ,1000
         HPWM 3 , 127 ,1000
       DelayMS  100
 Loop
 End

RGV250

Hi,
Do you need hardware PWM, I have not got the manual handy but thought there was a software version.

Bob

Yasin

It is a situation that Les's constantly suffering from. Caused by incorrect information in the PPI file due to Microchip instability. Open the file "12F1572.ppi" at "C:\Program Files (x86)\ProtonIDE\PDS\Includes\PPI" Replace the "HPWM=2" declaration with "HPWM=3".

Best regards.

eozkantar

#3
tşk , değiştirdim  çalıştı


Fanie

#4
Quote from: eozkantar on Jul 01, 2023, 08:17 PMtşk , değiştirdim  çalıştı
Burada Türk arkadaşlarımız var!
Türk dizilerini seviyorum, çoğunlukla iyi oyuncular ve oyuncu kadrosu iyi yazılmış. Güzel kadınlar da ;)
Ve Türklerin yaptığı silahları seviyorum.

Btw, Turkish kids are very clever !  At only a few years old they can already speak Turkish fluently.
I'm at if for months and I only recognize a few words.

eozkantar

#5
selam
12F1572 ile  4 hpwm çalıştı fakat
12F1501 ile  hiç hpwm çalışmadı...

kod
Device 12F1501
  Xtal = 4'MHZ
Config1 FOSC_INTOSC, WDTE_Off, PWRTE_ON, MCLRE_OFF, CP_OFF, BOREN_OFF, CLKOUTEN_OFF
Config2 WRT_OFF, STVREN_OFF,  LPBOR_OFF, LVP_OFF ',PLLEN_Off  BORV_hi ,

   Declare All_Digital TRUE         

   TRISA=  %00000000 ' TRISA= %11111111

Declare CCP1_Pin PORTA.2  ' Select HPWM port and bit for PWM 1 module (ch 1)
Declare CCP2_Pin PORTA.0' ' Select HPWM port and bit for PWM 2 module (ch 2)
Declare CCP3_Pin PORTA.4' ' Select HPWM port and bit for PWM 3 module (ch 3)
Declare CCP4_Pin PORTA.5' ' Select HPWM port and bit for PWM 3 module (ch 3)

 Do
         HPWM 1 , 32,2000
         HPWM 2 , 200,2000
         HPWM 3 , 127,2000
         HPWM 4 , 250,2000

         Toggle PORTA.1
       DelayMS  100
 Loop
 End

Yasin

Yine ppi dosya ile ilgili bir eksik olabilir. Microchip mcu ları her ne kadar aynı görünseler de asla aynı değiller. Bu sebeple ayrışan donanımlar için derleyici farklı kütüphaneler kullanmak zorunda. PPI dosya içerisindeki "HPWM_TYPE=" değiştirerek deneyebilirsin.

Quote from: Fanie on Jul 02, 2023, 01:06 AMAt only a few years old they can already speak Turkish fluently.
I'm at if for months and I only recognize a few words.
:D

eozkantar

tşk
maalesef  "HPWM_TYPE="  böyle bir satır yok

Yasin

12F1501 için şimdi kontrol ettim. PPI dosya içerisinde orada duruyor. Kullandığınız derleyici versiyonu nedir?

eozkantar

3.7.3.6



RAM_BANKS=1   ; Amount of User RAM Banks (1 - 16)
UART=0     ; Amount of UARTs. 0, 1, or 2
USB=0      ; Whether the device has USB capabilities
FLASH_WRITE=1  ; Whether the device has Self Modifying support. 0=No, 1=Read and Write, 2=Read no Write
MSSP=0     ; 0=None, 1=Single MSSP, 2=Dual MSSP, 3=SSP Only
HPWM=4     ; Amount of PWM channels (supported by the compiler)
BLOCK=16    ; Size of the Code Memory Write Segment (in Words)
ERASE=16    ; Size of the Code Memory Erase Segment (in Words)
OSCCALADDR=0  ; Address of the Oscillator Calibration Data
DEBUG=1     ; Whether the Device has Debug Capabilities (1 or 0)

Maxi

Dear @top204 could you tell us, what is correct ppi settins?
for 12F1501, 12F1571, 12F1572

top204

When creating the device info files from scratch, I always go to the safe side and make the HPWM channels 2, then over time, change them when I am confident in the library subroutines. Because Microchip keep changing for the sake of change, and some changes are so subtle, they cannot always be noticed.

I have just tested the PIC12F1572 device and the library routines work well with the three PWM channels, so you can go into the device's .PPI file and change it to "HPWM=3"