LitexCNC: firmware and driver for 5A-75B and 5A-75E

More
2 years 9 months ago #291373 by TOLP2
I'm afraid that the inverted PWM output is not supported yet, without doing some tricks. I think I will make an issue for this and add it to the firmware and driver.

Two possibilities:
  • inverting the output when compiling the firmware. Easiest to implement, however not very flexible
  • inverting the output using a HAL parameter, similar to GPIO which can also be inverted from the HAL. One can choose to:
    • either invert the duty-cycle (thus a duty-cycle of 5% will be send out as 95%, which is effectively the same as inversing the signal, however the start of the signal shifts) NOTE: this is the trick to 'invert' the signal in the current situation, by choosing scale and offset smart;
    • send an extra WORD to the FPGA with the config of the PWM. This case, the start of the PWM (and thus the frequency)  is always fixed.
If you have preferences, please let me know.

Please Log in or Create an account to join the conversation.

More
2 years 9 months ago #291396 by deroj
For me both are ok.
But then please explain the Trick image missing /media/kunena/emoticons/smile.png
I did not get it to work and therefore I changed Firmware.

Please Log in or Create an account to join the conversation.

More
2 years 9 months ago - 2 years 9 months ago #291463 by TOLP2
I made an issue / feature request on my GitHub for this:
github.com/Peter-van-Tol/LiteX-CNC/issues/76

I have chosen to add the extra WORD and add the param invert-output to the PWM modules.

@deroj: are you willing to test this branch?

The following steps can be taken to test the changes to LitexCNC:
Code:
pip3 install git+https://github.com/Peter-van-Tol/LiteX-CNC@76-add-option-invert-pwm-output

Re-install the driver and recompile the firmware:
Code:
sudo env "PATH=$PATH" litexcnc install_driver litexcnc build_firmware ... litexcnc flash_firmware ...

And try the new parameter invert-output for the PWM modules.
 
Last edit: 2 years 9 months ago by TOLP2. Reason: Work finished

Please Log in or Create an account to join the conversation.

More
2 years 9 months ago #291504 by deroj
I really would like to test it, but I am back home in two weeks... image missing /media/kunena/emoticons/wassat.png

Please Log in or Create an account to join the conversation.

More
2 years 9 months ago #291754 by vre
h
How can flash the firmware to 5A-75E?

Please Log in or Create an account to join the conversation.

More
2 years 9 months ago #291759 by Ehsan_R
litexcnc flash_firmware <filename-with-extension-svf>
How to create <filename-with-extension-svf> file?
Do I have to download it from somewhere?

Please Log in or Create an account to join the conversation.

Moderators: PCW, jmelson
Time to create page: 0.507 seconds
Powered by Kunena Forum