In a earlier post you mentioned the following:
“Unless you have good reasons, you should not create derived clocks but use one clock and strobe signals”
Now i would like to follow that advice and change my previous code, for instance:
@always_seq(CLK.posedge, reset=RESET) #CLK is 16MHz def clocks(): pwmcounter.next=pwmcounter+1 CLK4M.next = pwmcounter #8MHz for edge delay is output CLK8K.next = pwmcounter #8kHz control loop clock is output # control loop at approx. 8kHz @always_seq(CLK8K.posedge, reset=RESET) def control_loop(): if ~DISABLE: LEDLat.next=not LEDLat LED.next=LEDLat #control loop runs and output ENABLEd: indicate with led
Upon reading for instance “Alteras recommended design practices” - which is very informative -
I still can’t code this accordingly…
Would you kindly indicate how that would be done?