Hi,
I am to trying to generate PWM signals on EHRPWM Pin on Am62x Starter kit at U-Boot Level. We can generate PWM signals at Kernel Level. Can we do the same on U-Boot. If possible,Kindly guide me through the process.
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hi,
I am to trying to generate PWM signals on EHRPWM Pin on Am62x Starter kit at U-Boot Level. We can generate PWM signals at Kernel Level. Can we do the same on U-Boot. If possible,Kindly guide me through the process.
Hi Hong,
Thanks for the reply.
I am trying to control EPWM registers using mw and md commands in uboot.
I have followed the steps as per the Technical reference Manual Am62x. As per the Table 12-2999. EPWMx Initialization.
I have done done initialisation, but cant able to find any waveform on Pin EHRPWM1_B (E18).
Steps followed to generate PWM Signals on U-Boot.
Step 1: set E18 pin Am62x_sk.dts file as output:
ehrpwm_pins_default: ehrpwm-pins-default {
Step 3: Wrote 0x30h to register EPWM_TBCTL_REG.
=> mw.w 0x23010000 0x30
step 4: Wrote 0x258h to EPWM_TBPRD
=> mw.w 0x2301000A 0x258
step 5: Wrote 0x0c to CMPB Register
=> mw.w 0x23010012 0xc8
step 6: wrote 0x12 to EPWM_AQCTLA Register
=> mw.w 0x23010016 0x0012
Can you please check and let me know, where i am going Wrong.
Thanks,
Murali C
Hello Murali,
As Hong indicated, this is not a usecase that we have specifically enabled in software.
After enabling the clocks to the PWM, you can try reading from the PWM memory space. If you are able to perform valid reads, I would expect that means that the peripheral is being properly clocked.
In terms of the actual steps to configure the PWM by directly writing to the registers, the technical reference manual (TRM) is your best resource. If you need additional code references and the Linux driver is too complex, you might be able to reference the RTOS EPWM drivers of a similar device. e.g., AM64x MCU+ SDK, under source/drivers/epwm.
Regards,
Nick
Hi Nick,
Thanks for the reply.
i will try to read the PWM memory space.
Regards,
Murali