| Electronics > Beginners |
| Analog board start-up - How do you handle digital stuff? |
| (1/1) |
| TheUnnamedNewbie:
So I think this is going to be something that every person doing analog design goes through a lot - You get your devboard in with the PLL/DAC/VCO/... on it in, and you want to do the hello-world equivalent with it. How do you approach this? Currently, my go-to is just hook it up to an Arduino, but that ends up with a lot of convoluted coding. I was wondering if there is any system that is like the "opposite" of a logic analyzer, where I can visually draw the waveform I want to output on the parallel bus to set up the control registers and then hook up a board to execute them? |
| rstofer:
If I understand this, you want to output a parallel bus of signals and you want a convenient way to describe the various transitions versus time. I haven't done it but the Digilent Analog Discovery 2 will do this. You can download the free software and see what you can make of it. You would have 16 signals to do with as you will. Input, output, bus, whatever. https://reference.digilentinc.com/learn/instrumentation/tutorials/ad2-pattern-generator/start This isn't like 'drawing' a signal but it's close. |
| tggzzz:
Presuming you are talking about digital signals, I just code it directly in xC for the XMOS processors. Hence for a standard two-rows of alphanumeric characters with RW, E, and DATA lines, the code is: --- Code: ---static void lcdWriteByteNoWait(int byte) { uint32_t tStart; lcdRW <: 0 @ tStart; // set the RW line low, and record the time // high nybble lcdE @ (tStart+Tsp1) <: 1 ; // wait until Tsp1 later, then set the E line active lcdData @ (tStart+Tsp1+Tpw-Tsp2) <: (byte >> 4); // wait until it is "safe" to change the data lines, and then change them lcdE @ (tStart+Tsp1+Tpw) <: 0; // low nybble lcdE @ (tStart+Tsp1+Tcyc) <: 1 ; lcdData @ (tStart+Tsp1+Tcyc+Tpw-Tsp2) <: (byte & 0xf); lcdE @ (tStart+Tsp1+Tcyc+Tpw) <: 0; // complete the two cycles; use RW to avoid optimisation // and to give an external hint it has finished lcdRW @ (tStart+Tsp1+Tcyc+Tcyc) <: 1; } --- End code --- where the magic time constants are read directly from the data sheet --- Code: ---// interface timing in 100MHz ticks #define Tsp1 (6) // min 40ns #define Tsp2 (10) // min 80ns #define Thd2 (2) // min 10ns #define Tpw (26) // min 230ns #define Td (14) // min 120ns #define Tcyc (60) // min 500ns --- End code --- A good feature of the XMOS processors is that they can also be doing other time-critical I/O and processing simultaneously. In my frequency counter application, that means comms over a USB link, plus counting transitions in a 62.5 MHz input streams. |
| Navigation |
| Message Index |