GlasgowEmbedded / glasgow

Scots Army Knife for electronics
BSD Zero Clause License
1.88k stars 164 forks source link

Signal generator applet #608

Open ikarus23 opened 1 week ago

ikarus23 commented 1 week ago

Hi. It would be cool to have simple signal generator applet. I'm not sure about DACs on the Glasgow, but even a square signal from a normal IO would be great.

I found the control-servo applet which generates a limited PWM signal. This is a great start, but it would be great to have more freedom. Some features I'm thinking about:

  1. Simple square signal defined by providing a pulse with, a pause with and a pin.
  2. "Replaying" a signal: same as 1. but a string of 1 and 0 can be provided with 1 being a high signal using the pulse with and a 0 being a low signal using the pause width.
  3. Same as 1. or 2. but make it parallel. This would allow to specify multiple pins and to simulate a parallel bus signal.

This would also be great for some quick and rudimentary bit banging tests.

whitequark commented 1 week ago

My concern here is the degree of generality. Ultimately, you could consider any applet a type of "signal generator" since that's what Glasgow does. I think I can't accept such an applet upstream without a clearly defined and justified scope.

whitequark commented 1 week ago

Ultimately I also want it to be easy enough to add new applets that you wouldn't have to configure some monster with dozens of features to generate a signal similar to what you want; you would write a little bit of gateware that is exactly what you want.