I tell you that for many years I have not used this compiler and it may be a bit rusty in its use. I am using a TFT DSPIC P33FJ256GP710A plate from MIKROE and I am presented with a couple of problems that I commented to you:
Configuration of the Card to use the FLASH memory integrated in the board, therefore I use it in the compiler
Project -> edit project -> resources -> Externally
I compile again and the screens stop working
How do you load a library to use the on-board memory?
Also with the PWM I am trying to use two PWM channels, channel 1 and channel two. I attached the code I use.
The problem is in the duty cycle and the frequency of the second channel. If the first channel is different, the cycle is not fulfilled and on other occasions the output frequency is not.
The code used is:
Code: Select all
Sub procedure Inicializa_PWM()
Dim PWM_Period1 as word
Dim PWM_Period2 as word
' PWM 1
' Inicia Canal 1 del Con el TIMER 2
PWM_Period1 = PWM_Init(F_Base_PWM1,1,8,2)
' Ajuste al 50% el Canal 1
PWM_Set_Duty(PWM_Period1 div 2,1)
if PWM_1_ON = 0 then
PWM_Stop(1)
else
PWM_Start(1)
End if
' PWM 2
' Inicia Canal 2 del Con el TIMER 3
PWM_Period2 = PWM_Init(F_Base_PWM2,2,8,3)
' Ajuste al 50% el Canal 2
PWM_Set_Duty(PWM_Period2 div 2,2)
if PWM_2_ON = 0 then
PWM_Stop(2)
else
PWM_Start(2)
End if
end sub
Variables are reviewed and load the correct values
What can be?
Thank you so much