Author Topic: Analog board start-up - How do you handle digital stuff?  (Read 919 times)

0 Members and 1 Guest are viewing this topic.

Offline TheUnnamedNewbieTopic starter

  • Super Contributor
  • ***
  • Posts: 1211
  • Country: 00
  • mmwave RFIC/antenna designer
Analog board start-up - How do you handle digital stuff?
« on: June 29, 2018, 11:39:10 am »
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?
The best part about magic is when it stops being magic and becomes science instead

"There was no road, but the people walked on it, and the road came to be, and the people followed it, for the road took the path of least resistance"
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9933
  • Country: us
Re: Analog board start-up - How do you handle digital stuff?
« Reply #1 on: June 29, 2018, 01:51:05 pm »
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.
 

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 20551
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: Analog board start-up - How do you handle digital stuff?
« Reply #2 on: June 29, 2018, 01:56:24 pm »
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: [Select]
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;
}
where the magic time constants are read directly from the data sheet
Code: [Select]
// 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

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.
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf