Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > sci.electronics.design > #482382 > unrolled thread

Signals and Systems for Dummies

Started byJohn Larkin <jjlarkin@highlandtechnology.com>
First post2017-10-21 10:03 -0700
Last post2017-10-24 08:41 -0700
Articles 20 on this page of 157 — 28 participants

Back to article view | Back to sci.electronics.design


Contents

  Signals and Systems for Dummies John Larkin <jjlarkin@highlandtechnology.com> - 2017-10-21 10:03 -0700
    Re: Signals and Systems for Dummies rickman <gnuarm@gmail.com> - 2017-10-21 15:01 -0400
      Re: Signals and Systems for Dummies bitrex <bitrex@de.lete.earthlink.net> - 2017-10-21 15:34 -0400
        Re: Signals and Systems for Dummies rickman <gnuarm@gmail.com> - 2017-10-21 17:12 -0400
          Re: Signals and Systems for Dummies Klaus Kragelund <klauskvik@hotmail.com> - 2017-10-21 14:19 -0700
            Re: Signals and Systems for Dummies John Larkin <jjlarkin@highlandtechnology.com> - 2017-10-21 15:33 -0700
              Re: Signals and Systems for Dummies rickman <gnuarm@gmail.com> - 2017-10-21 19:50 -0400
              Re: Signals and Systems for Dummies David Brown <david.brown@hesbynett.no> - 2017-10-23 12:58 +0200
                Re: Signals and Systems for Dummies bitrex <bitrex@de.lete.earthlink.net> - 2017-10-23 10:08 -0400
                  Re: Signals and Systems for Dummies David Brown <david.brown@hesbynett.no> - 2017-10-23 16:44 +0200
                    Re: Signals and Systems for Dummies John Larkin <jjlarkin@highlandtechnology.com> - 2017-10-23 09:26 -0700
                      Re: Signals and Systems for Dummies bitrex <bitrex@de.lete.earthlink.net> - 2017-10-23 14:07 -0400
                        Re: Signals and Systems for Dummies John Larkin <jjlarkin@highlandtechnology.com> - 2017-10-23 19:30 -0700
                          Re: Signals and Systems for Dummies rickman <gnuarm@gmail.com> - 2017-10-23 22:50 -0400
                            Re: Signals and Systems for Dummies bitrex <bitrex@de.lete.earthlink.net> - 2017-10-23 23:43 -0400
                              Re: Signals and Systems for Dummies rickman <gnuarm@gmail.com> - 2017-10-23 23:53 -0400
                              Re: Signals and Systems for Dummies John Larkin <jjlarkin@highlandtechnology.com> - 2017-10-23 21:50 -0700
                  Re: Signals and Systems for Dummies John Larkin <jjlarkin@highlandtechnology.com> - 2017-10-23 08:57 -0700
                    Re: Signals and Systems for Dummies antispam@math.uni.wroc.pl - 2017-10-23 16:45 +0000
                      Re: Signals and Systems for Dummies John Larkin <jjlarkin@highlandtechnology.com> - 2017-10-23 10:09 -0700
                      Re: Signals and Systems for Dummies Tom Gardner <spamjunk@blueyonder.co.uk> - 2017-10-23 18:25 +0100
                        Re: Signals and Systems for Dummies Jan Panteltje <pNaOnStPeAlMtje@yahoo.com> - 2017-10-24 09:44 +0000
                          Re: Signals and Systems for Dummies Tom Gardner <spamjunk@blueyonder.co.uk> - 2017-10-24 11:26 +0100
                            Re: Signals and Systems for Dummies rickman <gnuarm@gmail.com> - 2017-10-24 21:55 -0400
                              Re: Signals and Systems for Dummies Tom Gardner <spamjunk@blueyonder.co.uk> - 2017-10-25 09:03 +0100
                                Re: Signals and Systems for Dummies John Larkin <jjlarkin@highlandtechnology.com> - 2017-10-25 09:11 -0700
                                  Re: Signals and Systems for Dummies Tom Gardner <spamjunk@blueyonder.co.uk> - 2017-10-25 18:22 +0100
                                Re: Signals and Systems for Dummies rickman <gnuarm@gmail.com> - 2017-10-27 18:38 -0400
                                  Re: Signals and Systems for Dummies Tom Gardner <spamjunk@blueyonder.co.uk> - 2017-10-28 01:05 +0100
                                    Re: Signals and Systems for Dummies rickman <gnuarm@gmail.com> - 2017-10-27 20:26 -0400
                                      Re: Signals and Systems for Dummies Tom Gardner <spamjunk@blueyonder.co.uk> - 2017-10-28 09:07 +0100
                                  Re: Signals and Systems for Dummies upsidedown@downunder.com - 2017-10-28 12:41 +0300
                      Re: Signals and Systems for Dummies bitrex <bitrex@de.lete.earthlink.net> - 2017-10-23 14:31 -0400
                        Re: Signals and Systems for Dummies Jan Panteltje <pNaOnStPeAlMtje@yahoo.com> - 2017-10-24 09:43 +0000
                          Re: Signals and Systems for Dummies David Brown <david.brown@hesbynett.no> - 2017-10-24 12:13 +0200
                            Re: Signals and Systems for Dummies Jan Panteltje <pNaonStpealmtje@yahoo.com> - 2017-10-24 10:40 +0000
                              Re: Signals and Systems for Dummies David Brown <david.brown@hesbynett.no> - 2017-10-24 13:02 +0200
                                Re: Signals and Systems for Dummies bitrex <bitrex@de.lete.earthlink.net> - 2017-10-24 08:41 -0400
                                  Re: Signals and Systems for Dummies Jan Panteltje <pNaOnStPeAlMtje@yahoo.com> - 2017-10-24 13:09 +0000
                                    Re: Signals and Systems for Dummies bitrex <bitrex@de.lete.earthlink.net> - 2017-10-24 09:58 -0400
                                      Re: Signals and Systems for Dummies Jan Panteltje <pNaOnStPeAlMtje@yahoo.com> - 2017-10-24 15:16 +0000
                                        Re: Signals and Systems for Dummies bitrex <bitrex@de.lete.earthlink.net> - 2017-10-24 11:31 -0400
                                          Re: Signals and Systems for Dummies Jan Panteltje <pNaOnStPeAlMtje@yahoo.com> - 2017-10-24 16:46 +0000
                                            Re: Signals and Systems for Dummies bitrex <bitrex@de.lete.earthlink.net> - 2017-10-24 15:46 -0400
                                              Re: Signals and Systems for Dummies Jan Panteltje <pNaOnStPeAlMtje@yahoo.com> - 2017-10-25 12:01 +0000
                                                Re: Signals and Systems for Dummies krw@notreal.com - 2017-10-25 20:28 -0400
                                                  Re: Signals and Systems for Dummies Michael A Terrell <mike.terrell@earthlink.net> - 2017-10-25 20:52 -0400
                                    Re: Signals and Systems for Dummies bitrex <bitrex@de.lete.earthlink.net> - 2017-10-24 10:04 -0400
                                      Re: Signals and Systems for Dummies Jan Panteltje <pNaOnStPeAlMtje@yahoo.com> - 2017-10-24 15:16 +0000
                                  Re: Signals and Systems for Dummies David Brown <david.brown@hesbynett.no> - 2017-10-24 16:25 +0200
                                    Re: Signals and Systems for Dummies bitrex <bitrex@de.lete.earthlink.net> - 2017-10-24 11:14 -0400
                                      Re: Signals and Systems for Dummies Jan Panteltje <pNaOnStPeAlMtje@yahoo.com> - 2017-10-24 16:46 +0000
                                        Re: Signals and Systems for Dummies bitrex <bitrex@de.lete.earthlink.net> - 2017-10-24 16:02 -0400
                                          Re: Signals and Systems for Dummies bitrex <bitrex@de.lete.earthlink.net> - 2017-10-24 16:20 -0400
                                            Re: Signals and Systems for Dummies bitrex <bitrex@de.lete.earthlink.net> - 2017-10-24 16:28 -0400
                                          Re: Signals and Systems for Dummies Jan Panteltje <pNaOnStPeAlMtje@yahoo.com> - 2017-10-25 12:01 +0000
                                    Re: Signals and Systems for Dummies Jan Panteltje <pNaOnStPeAlMtje@yahoo.com> - 2017-10-24 15:16 +0000
                                    Re: Signals and Systems for Dummies bitrex <bitrex@de.lete.earthlink.net> - 2017-10-24 11:28 -0400
                                      Re: Signals and Systems for Dummies David Brown <david.brown@hesbynett.no> - 2017-10-25 10:33 +0200
                                Re: Signals and Systems for Dummies Jan Panteltje <pNaOnStPeAlMtje@yahoo.com> - 2017-10-24 13:09 +0000
                    Re: Signals and Systems for Dummies rickman <gnuarm@gmail.com> - 2017-10-23 22:20 -0400
                Re: Signals and Systems for Dummies John Larkin <jjlarkin@highlandtechnology.com> - 2017-10-23 07:55 -0700
                  Re: Signals and Systems for Dummies Klaus Kragelund <klauskvik@hotmail.com> - 2017-10-23 08:54 -0700
                    Re: Signals and Systems for Dummies John Larkin <jjlarkin@highlandtechnology.com> - 2017-10-23 09:35 -0700
                      Re: Signals and Systems for Dummies rickman <gnuarm@gmail.com> - 2017-10-23 22:25 -0400
                  Re: Signals and Systems for Dummies David Brown <david.brown@hesbynett.no> - 2017-10-24 10:41 +0200
                    Re: Signals and Systems for Dummies Tom Gardner <spamjunk@blueyonder.co.uk> - 2017-10-24 10:23 +0100
                      Re: Signals and Systems for Dummies John Larkin <jjlarkin@highlandtechnology.com> - 2017-10-24 02:35 -0700
                        Re: Signals and Systems for Dummies Tom Gardner <spamjunk@blueyonder.co.uk> - 2017-10-24 10:51 +0100
                        Re: Signals and Systems for Dummies David Brown <david.brown@hesbynett.no> - 2017-10-24 12:38 +0200
                          Re: Signals and Systems for Dummies Tom Gardner <spamjunk@blueyonder.co.uk> - 2017-10-24 12:03 +0100
                          Re: Signals and Systems for Dummies Clifford Heath <no.spam@please.net> - 2017-10-21 10:53 +1100
                            Re: Signals and Systems for Dummies Tom Gardner <spamjunk@blueyonder.co.uk> - 2017-10-25 09:04 +0100
                              Re: Signals and Systems for Dummies Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> - 2017-10-25 10:16 -0400
                                Re: Signals and Systems for Dummies Clifford Heath <no.spam@please.net> - 2017-10-22 09:13 +1100
                                Re: Signals and Systems for Dummies Tom Gardner <spamjunk@blueyonder.co.uk> - 2017-10-26 08:41 +0100
                                  Re: Signals and Systems for Dummies pcdhobbs@gmail.com - 2017-10-26 02:24 -0700
                                    Re: Signals and Systems for Dummies John Larkin <jjlarkin@highland_snip_technology.com> - 2017-10-26 10:30 -0700
                      Re: Signals and Systems for Dummies David Brown <david.brown@hesbynett.no> - 2017-10-24 12:22 +0200
                  Re: Signals and Systems for Dummies "Tom Del Rosso" <fizzbintuesday@that-google-mail-domain.com> - 2017-10-25 04:05 -0400
                Re: Signals and Systems for Dummies Jasen Betts <jasen@xnet.co.nz> - 2017-10-24 18:52 +0000
          Re: Signals and Systems for Dummies Piotr Wyderski <peter.pan@neverland.mil> - 2017-10-22 11:17 +0200
            Re: Signals and Systems for Dummies John Larkin <jjlarkin@highlandtechnology.com> - 2017-10-22 09:36 -0700
          Re: Signals and Systems for Dummies Klaus Kragelund <klauskvik@hotmail.com> - 2017-10-22 04:25 -0700
            Re: Signals and Systems for Dummies rickman <gnuarm@gmail.com> - 2017-10-22 18:50 -0400
        Re: Signals and Systems for Dummies TTman <kraken.sankey@gmail.com> - 2017-10-21 23:00 +0100
          Re: Signals and Systems for Dummies Jan Panteltje <pNaOnStPeAlMtje@yahoo.com> - 2017-10-22 08:19 +0000
        Re: Signals and Systems for Dummies David Brown <david.brown@hesbynett.no> - 2017-10-23 12:37 +0200
          Re: Signals and Systems for Dummies Chris Jones <lugnut808@spam.yahoo.com> - 2017-10-23 23:15 +1100
            Re: Signals and Systems for Dummies David Brown <david.brown@hesbynett.no> - 2017-10-23 14:55 +0200
              Re: Signals and Systems for Dummies Chris Jones <lugnut808@spam.yahoo.com> - 2017-10-24 00:24 +1100
                Re: Signals and Systems for Dummies David Brown <david.brown@hesbynett.no> - 2017-10-23 15:54 +0200
                  Re: Signals and Systems for Dummies Jan Panteltje <pNaOnStPeAlMtje@yahoo.com> - 2017-10-23 16:24 +0000
                    Re: Signals and Systems for Dummies Tom Gardner <spamjunk@blueyonder.co.uk> - 2017-10-23 17:43 +0100
                      Re: Signals and Systems for Dummies Jan Panteltje <pNaOnStPeAlMtje@yahoo.com> - 2017-10-23 17:26 +0000
                        Re: Signals and Systems for Dummies Tom Gardner <spamjunk@blueyonder.co.uk> - 2017-10-23 18:40 +0100
                          Re: Signals and Systems for Dummies Jan Panteltje <pNaOnStPeAlMtje@yahoo.com> - 2017-10-23 17:46 +0000
                            Re: Signals and Systems for Dummies Tom Gardner <spamjunk@blueyonder.co.uk> - 2017-10-23 19:01 +0100
                      Re: Signals and Systems for Dummies David Brown <david.brown@hesbynett.no> - 2017-10-24 11:01 +0200
                        Re: Signals and Systems for Dummies Tom Gardner <spamjunk@blueyonder.co.uk> - 2017-10-24 10:36 +0100
                          Re: Signals and Systems for Dummies David Brown <david.brown@hesbynett.no> - 2017-10-24 12:57 +0200
                            Re: Signals and Systems for Dummies Tom Gardner <spamjunk@blueyonder.co.uk> - 2017-10-24 13:09 +0100
                              Re: Signals and Systems for Dummies David Brown <david.brown@hesbynett.no> - 2017-10-24 14:38 +0200
                  Re: Signals and Systems for Dummies Chris Jones <lugnut808@spam.yahoo.com> - 2017-10-25 16:34 +1100
                    Re: Signals and Systems for Dummies kevin93 <kevin@whitedigs.com> - 2017-10-25 08:38 -0700
            Re: Signals and Systems for Dummies Jan Panteltje <pNaOnStPeAlMtje@yahoo.com> - 2017-10-23 16:24 +0000
              Re: Signals and Systems for Dummies John Larkin <jjlarkin@highlandtechnology.com> - 2017-10-23 09:39 -0700
          Re: Signals and Systems for Dummies John Larkin <jjlarkin@highlandtechnology.com> - 2017-10-23 09:00 -0700
            Re: Signals and Systems for Dummies bill.sloman@ieee.org - 2017-10-24 20:45 -0700
          Re: Signals and Systems for Dummies Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> - 2017-10-23 13:02 -0400
            Re: Signals and Systems for Dummies John Larkin <jjlarkin@highlandtechnology.com> - 2017-10-23 10:05 -0700
            Re: Signals and Systems for Dummies John Larkin <jjlarkin@highland_snip_technology.com> - 2017-10-23 11:18 -0700
              Re: Signals and Systems for Dummies Lasse Langwadt Christensen <langwadt@fonz.dk> - 2017-10-23 12:22 -0700
            Re: Signals and Systems for Dummies bitrex <bitrex@de.lete.earthlink.net> - 2017-10-23 14:43 -0400
              Re: Signals and Systems for Dummies John Larkin <jjlarkin@highland_snip_technology.com> - 2017-10-23 12:05 -0700
                Re: Signals and Systems for Dummies Lasse Langwadt Christensen <langwadt@fonz.dk> - 2017-10-23 12:28 -0700
                Re: Signals and Systems for Dummies bitrex <bitrex@de.lete.earthlink.net> - 2017-10-23 15:32 -0400
                  Re: Signals and Systems for Dummies Lasse Langwadt Christensen <langwadt@fonz.dk> - 2017-10-23 12:46 -0700
                  Re: Signals and Systems for Dummies John Larkin <jjlarkin@highland_snip_technology.com> - 2017-10-23 15:28 -0700
                Re: Signals and Systems for Dummies bitrex <bitrex@de.lete.earthlink.net> - 2017-10-23 15:37 -0400
                Re: Signals and Systems for Dummies Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> - 2017-10-23 15:43 -0400
            Re: Signals and Systems for Dummies David Brown <david.brown@hesbynett.no> - 2017-10-24 11:10 +0200
              Re: Signals and Systems for Dummies Lasse Langwadt Christensen <langwadt@fonz.dk> - 2017-10-24 10:16 -0700
                Re: Signals and Systems for Dummies David Brown <david.brown@hesbynett.no> - 2017-10-25 10:43 +0200
      Re: Signals and Systems for Dummies upsidedown@downunder.com - 2017-10-22 15:40 +0300
        Re: Signals and Systems for Dummies David Brown <david.brown@hesbynett.no> - 2017-10-23 13:09 +0200
          Re: Signals and Systems for Dummies Jan Panteltje <pNaOnStPeAlMtje@yahoo.com> - 2017-10-23 16:24 +0000
            Re: Signals and Systems for Dummies bitrex <bitrex@de.lete.earthlink.net> - 2017-10-23 15:44 -0400
              Re: Signals and Systems for Dummies Jan Panteltje <pNaOnStPeAlMtje@yahoo.com> - 2017-10-24 09:43 +0000
          Re: Signals and Systems for Dummies Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> - 2017-10-23 13:21 -0400
            Re: Signals and Systems for Dummies John Devereux <john@devereux.me.uk> - 2017-10-23 19:40 +0100
              Re: Signals and Systems for Dummies Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> - 2017-10-23 15:46 -0400
                Re: Signals and Systems for Dummies Klaus Kragelund <klauskvik@hotmail.com> - 2017-10-23 18:10 -0700
                Re: Signals and Systems for Dummies John Devereux <john@devereux.me.uk> - 2017-10-26 10:41 +0100
                  Re: Signals and Systems for Dummies Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> - 2017-10-26 10:52 -0400
                    Re: Signals and Systems for Dummies Clifford Heath <no.spam@please.net> - 2017-10-23 08:51 +1100
                      Re: Signals and Systems for Dummies pcdhobbs@gmail.com - 2017-10-26 16:03 -0700
                        Re: Signals and Systems for Dummies Clifford Heath <no.spam@please.net> - 2017-10-27 10:14 +1100
                        Re: Signals and Systems for Dummies John Devereux <john@devereux.me.uk> - 2017-10-27 08:28 +0100
                          Re: Signals and Systems for Dummies David Brown <david.brown@hesbynett.no> - 2017-10-27 10:46 +0200
                        Re: Signals and Systems for Dummies Tauno Voipio <tauno.voipio@notused.fi.invalid> - 2017-11-08 21:19 +0200
              Re: Signals and Systems for Dummies David Brown <david.brown@hesbynett.no> - 2017-10-24 11:19 +0200
        Re: Signals and Systems for Dummies John Larkin <jjlarkin@highlandtechnology.com> - 2017-10-23 09:14 -0700
      Re: Signals and Systems for Dummies Tom Gardner <spamjunk@blueyonder.co.uk> - 2017-10-22 13:54 +0100
        Re: Signals and Systems for Dummies John Larkin <jjlarkin@highlandtechnology.com> - 2017-10-22 09:43 -0700
          Re: Signals and Systems for Dummies Tom Gardner <spamjunk@blueyonder.co.uk> - 2017-10-22 18:11 +0100
            Re: Signals and Systems for Dummies John Larkin <jjlarkin@highlandtechnology.com> - 2017-10-22 10:33 -0700
              Re: Signals and Systems for Dummies John Devereux <john@devereux.me.uk> - 2017-10-22 19:09 +0100
              Re: Signals and Systems for Dummies David Brown <david.brown@hesbynett.no> - 2017-10-23 13:16 +0200
            Re: Signals and Systems for Dummies Lasse Langwadt Christensen <langwadt@fonz.dk> - 2017-10-22 10:33 -0700
              Re: Signals and Systems for Dummies boB <boB@K7IQ.com> - 2017-10-22 15:09 -0700
                Re: Signals and Systems for Dummies Lasse Langwadt Christensen <langwadt@fonz.dk> - 2017-10-22 16:07 -0700
              Re: Signals and Systems for Dummies John Larkin <jjlarkin@highlandtechnology.com> - 2017-10-22 15:49 -0700
            Re: Signals and Systems for Dummies David Brown <david.brown@hesbynett.no> - 2017-10-23 13:14 +0200
          Re: Signals and Systems for Dummies Lasse Langwadt Christensen <langwadt@fonz.dk> - 2017-10-22 16:11 -0700
    Re: Signals and Systems for Dummies bloggs.fredbloggs.fred@gmail.com - 2017-10-24 07:41 -0700
      Re: Signals and Systems for Dummies John Larkin <jjlarkin@highlandtechnology.com> - 2017-10-24 08:41 -0700

Page 7 of 8 — ← Prev page 1 2 3 4 5 6 [7] 8  Next page →


#482581

FromPhil Hobbs <pcdhSpamMeSenseless@electrooptical.net>
Date2017-10-23 15:43 -0400
Message-ID<M62dnZex-Lnb23PEnZ2dnUU7-TWdnZ2d@supernews.com>
In reply to#482574
On 10/23/2017 03:05 PM, John Larkin wrote:
> On Mon, 23 Oct 2017 14:43:34 -0400, bitrex
> <bitrex@de.lete.earthlink.net> wrote:
> 
>> On 10/23/2017 01:02 PM, Phil Hobbs wrote:
>>
>>>> Of course interrupt jitter can be a problem on RISC processors.  How
>>>> much of a problem depends on your needs, and on the cpu.  On some AVRs
>>>> instructions can take as long as 7 cycles (like far calls on the big
>>>> devices).  On a small ARMs (Cortex-M), such as the OP's, the variation
>>>> in the interrupt response from the cpu is going to be small and
>>>> deterministic - but it still varies.
>>>
>>> The interrupt latency on an ARM Cortex M3 is guaranteed to be exactly 12
>>> cycles when coming from mainline code, and 8 cycles when coming from a
>>> lower-priority ISR.  (There are caveats on this in the ARM docs, but
>>> we've found it to be so in practical cases.)
>>>
>>> Works very nicely. JL said that there were no other interrupts,
>>> interrupts are never disabled, and the interrupt is generated
>>> synchronously with the CPU clock, so where's the jitter coming from?
>>> Seems as though the clock oscillator is the only major contributor.
>>>
>>>
>>> Cheers
>>>
>>> Phil Hobbs
>>>
>>>
>>
>> The only place it could come from is that the ISR can interrupt a 
>> mainline instruction mid-execution and it doesn't "know" how many clock 
>> cycles that instruction has left to complete after the interrupt returns.
> 
> The interrupt hardware could just do a timeout that's longer than the
> longest instruction.
> 
> Some divides can take 12 clocks in an M3, coincidence?, but I doubt
> that we'll be doing any divides.
> 
> 
It's guaranteed to be 12, anyway.

Cheers

Phil Hobbs

-- 
Dr Philip C D Hobbs
Principal Consultant
ElectroOptical Innovations LLC
Optics, Electro-optics, Photonics, Analog Electronics

160 North State Road #203
Briarcliff Manor NY 10510

hobbs at electrooptical dot net
http://electrooptical.net

[toc] | [prev] | [next] | [standalone]


#482641

FromDavid Brown <david.brown@hesbynett.no>
Date2017-10-24 11:10 +0200
Message-ID<osn029$8qo$1@dont-email.me>
In reply to#482557
On 23/10/17 19:02, Phil Hobbs wrote:
> On 10/23/2017 06:37 AM, David Brown wrote:
>> On 21/10/17 21:34, bitrex wrote:
>>> On 10/21/2017 03:01 PM, rickman wrote:
>>>> John Larkin wrote on 10/21/2017 1:03 PM:
>>>>> I have the book:
>>>>>
>>>>> https://www.amazon.com/Signals-Systems-Dummies-Mark-Wickert/dp/111847581X/ref=sr_1_1?ie=UTF8&qid=1508604326&sr=8-1&keywords=signals+systems+dummies
>>>>>
>>>>>
>>>>>
>>>>> Here's my DDS sim. A tiny ARM cpu generates a DDS sine wave in
>>>>> software, with a 50 KHz interrupt rate and its internal 10 bit DAC.
>>>>> The spice sim uses a sample+hold and quantizer to simulate that.
>>>>>
>>>>> When V4 is around 400 Hz, the output looks really nice. At, say, 5377
>>>>> Hz, you can zoom in on the voltage peaks and see them getting ragged.
>>>>> The FFT shows the corresponding sidebands around 50 KHz.
>>>>>
>>>>> This stuff is fun, in a geeky sort of way. Better than working on the
>>>>> deck.
>>>>>
>>>>> The filter was made from parts that were already on the pcb BOM; it's
>>>>> not bad.
>>>>
>>>> Driving timing from an interrupt can add jitter.  Better to use a part
>>>> with DMA driving the ADC.  The the software timing only needs to keep
>>>> up with the data rate keeping the DMA buffer full.  The only jitter
>>>> will be from the actual clock and not any clock cycle level jitter in
>>>> the CPU.
>>>>
>>>
>>> Interrupt jitter isn't that big a problem on RISC processors; well 8 bit
>>> AVRs, at least - the only jitter in the interrupt timing is due to the
>>> fact that not all instructions take exactly one cycle to complete and
>>> the ISR can't execute until whatever it is is done, but nearly all take
>>> a single cycle, some take two, and a very small number take four. The
>>> typical jitter isn't more than one clock slow or fast, and if you're
>>> running it at 20MHz and using a 16 bit counter that's going to be about
>>> a thousandth of a percent of the PWM base frequency.
>>>
>>
>> Of course interrupt jitter can be a problem on RISC processors.  How
>> much of a problem depends on your needs, and on the cpu.  On some AVRs
>> instructions can take as long as 7 cycles (like far calls on the big
>> devices).  On a small ARMs (Cortex-M), such as the OP's, the variation
>> in the interrupt response from the cpu is going to be small and
>> deterministic - but it still varies.
> 
> The interrupt latency on an ARM Cortex M3 is guaranteed to be exactly 12
> cycles when coming from mainline code, and 8 cycles when coming from a
> lower-priority ISR.  (There are caveats on this in the ARM docs, but
> we've found it to be so in practical cases.)

No, that is not the case.  Look it up in the docs.

12 cycles is the nominal latency - but it can be greater due to wait
states or other complications.  Faster Cortex M devices usually always
have wait states on flash if your code (and interrupt vectors) are not
in the flash pre-fetch buffers.  You don't get 8 cycles when you are
inside a lower-priority ISR - you simply save a few cycles if you are
currently in the interrupt entry or exit stages of a lower priority ISR.

For a slower M3, where the flash speed keeps up with the core, you will
get quite stable interrupt response timings.  For faster devices, they
are deterministic in having a guaranteed maximum delay (which can be
calculated from the clock rates, wait states, flash details, etc.).  And
/most/ interrupts will have the same response time - but you can
occasionally have ones that take longer (but within a known limit).

> 
> Works very nicely. JL said that there were no other interrupts,
> interrupts are never disabled, and the interrupt is generated
> synchronously with the CPU clock, so where's the jitter coming from?
> Seems as though the clock oscillator is the only major contributor.
> 
> 
> Cheers
> 
> Phil Hobbs
> 
> 

[toc] | [prev] | [next] | [standalone]


#482712

FromLasse Langwadt Christensen <langwadt@fonz.dk>
Date2017-10-24 10:16 -0700
Message-ID<53d58328-a5ec-4236-9ff3-3e366fb8e800@googlegroups.com>
In reply to#482641
Den tirsdag den 24. oktober 2017 kl. 11.10.37 UTC+2 skrev David Brown:
> On 23/10/17 19:02, Phil Hobbs wrote:
> > On 10/23/2017 06:37 AM, David Brown wrote:
> >> On 21/10/17 21:34, bitrex wrote:
> >>> On 10/21/2017 03:01 PM, rickman wrote:
> >>>> John Larkin wrote on 10/21/2017 1:03 PM:
> >>>>> I have the book:
> >>>>>
> >>>>> https://www.amazon.com/Signals-Systems-Dummies-Mark-Wickert/dp/111847581X/ref=sr_1_1?ie=UTF8&qid=1508604326&sr=8-1&keywords=signals+systems+dummies
> >>>>>
> >>>>>
> >>>>>
> >>>>> Here's my DDS sim. A tiny ARM cpu generates a DDS sine wave in
> >>>>> software, with a 50 KHz interrupt rate and its internal 10 bit DAC.
> >>>>> The spice sim uses a sample+hold and quantizer to simulate that.
> >>>>>
> >>>>> When V4 is around 400 Hz, the output looks really nice. At, say, 5377
> >>>>> Hz, you can zoom in on the voltage peaks and see them getting ragged.
> >>>>> The FFT shows the corresponding sidebands around 50 KHz.
> >>>>>
> >>>>> This stuff is fun, in a geeky sort of way. Better than working on the
> >>>>> deck.
> >>>>>
> >>>>> The filter was made from parts that were already on the pcb BOM; it's
> >>>>> not bad.
> >>>>
> >>>> Driving timing from an interrupt can add jitter.  Better to use a part
> >>>> with DMA driving the ADC.  The the software timing only needs to keep
> >>>> up with the data rate keeping the DMA buffer full.  The only jitter
> >>>> will be from the actual clock and not any clock cycle level jitter in
> >>>> the CPU.
> >>>>
> >>>
> >>> Interrupt jitter isn't that big a problem on RISC processors; well 8 bit
> >>> AVRs, at least - the only jitter in the interrupt timing is due to the
> >>> fact that not all instructions take exactly one cycle to complete and
> >>> the ISR can't execute until whatever it is is done, but nearly all take
> >>> a single cycle, some take two, and a very small number take four. The
> >>> typical jitter isn't more than one clock slow or fast, and if you're
> >>> running it at 20MHz and using a 16 bit counter that's going to be about
> >>> a thousandth of a percent of the PWM base frequency.
> >>>
> >>
> >> Of course interrupt jitter can be a problem on RISC processors.  How
> >> much of a problem depends on your needs, and on the cpu.  On some AVRs
> >> instructions can take as long as 7 cycles (like far calls on the big
> >> devices).  On a small ARMs (Cortex-M), such as the OP's, the variation
> >> in the interrupt response from the cpu is going to be small and
> >> deterministic - but it still varies.
> > 
> > The interrupt latency on an ARM Cortex M3 is guaranteed to be exactly 12
> > cycles when coming from mainline code, and 8 cycles when coming from a
> > lower-priority ISR.  (There are caveats on this in the ARM docs, but
> > we've found it to be so in practical cases.)
> 
> No, that is not the case.  Look it up in the docs.
> 
> 12 cycles is the nominal latency - but it can be greater due to wait
> states or other complications.  Faster Cortex M devices usually always
> have wait states on flash if your code (and interrupt vectors) are not
> in the flash pre-fetch buffers.  

reading from flash should be possible in parallel with the registers being pushed on the stack, so there should 12 cycles to fetch a vector and then 
the first interrupt instruction


[toc] | [prev] | [next] | [standalone]


#483038

FromDavid Brown <david.brown@hesbynett.no>
Date2017-10-25 10:43 +0200
Message-ID<ospiql$2cl$1@dont-email.me>
In reply to#482712
On 24/10/17 19:16, Lasse Langwadt Christensen wrote:
> Den tirsdag den 24. oktober 2017 kl. 11.10.37 UTC+2 skrev David Brown:
>> On 23/10/17 19:02, Phil Hobbs wrote:
>>> On 10/23/2017 06:37 AM, David Brown wrote:
>>>> On 21/10/17 21:34, bitrex wrote:
>>>>> On 10/21/2017 03:01 PM, rickman wrote:
>>>>>> John Larkin wrote on 10/21/2017 1:03 PM:
>>>>>>> I have the book:
>>>>>>>
>>>>>>> https://www.amazon.com/Signals-Systems-Dummies-Mark-Wickert/dp/111847581X/ref=sr_1_1?ie=UTF8&qid=1508604326&sr=8-1&keywords=signals+systems+dummies
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Here's my DDS sim. A tiny ARM cpu generates a DDS sine wave in
>>>>>>> software, with a 50 KHz interrupt rate and its internal 10 bit DAC.
>>>>>>> The spice sim uses a sample+hold and quantizer to simulate that.
>>>>>>>
>>>>>>> When V4 is around 400 Hz, the output looks really nice. At, say, 5377
>>>>>>> Hz, you can zoom in on the voltage peaks and see them getting ragged.
>>>>>>> The FFT shows the corresponding sidebands around 50 KHz.
>>>>>>>
>>>>>>> This stuff is fun, in a geeky sort of way. Better than working on the
>>>>>>> deck.
>>>>>>>
>>>>>>> The filter was made from parts that were already on the pcb BOM; it's
>>>>>>> not bad.
>>>>>>
>>>>>> Driving timing from an interrupt can add jitter.  Better to use a part
>>>>>> with DMA driving the ADC.  The the software timing only needs to keep
>>>>>> up with the data rate keeping the DMA buffer full.  The only jitter
>>>>>> will be from the actual clock and not any clock cycle level jitter in
>>>>>> the CPU.
>>>>>>
>>>>>
>>>>> Interrupt jitter isn't that big a problem on RISC processors; well 8 bit
>>>>> AVRs, at least - the only jitter in the interrupt timing is due to the
>>>>> fact that not all instructions take exactly one cycle to complete and
>>>>> the ISR can't execute until whatever it is is done, but nearly all take
>>>>> a single cycle, some take two, and a very small number take four. The
>>>>> typical jitter isn't more than one clock slow or fast, and if you're
>>>>> running it at 20MHz and using a 16 bit counter that's going to be about
>>>>> a thousandth of a percent of the PWM base frequency.
>>>>>
>>>>
>>>> Of course interrupt jitter can be a problem on RISC processors.  How
>>>> much of a problem depends on your needs, and on the cpu.  On some AVRs
>>>> instructions can take as long as 7 cycles (like far calls on the big
>>>> devices).  On a small ARMs (Cortex-M), such as the OP's, the variation
>>>> in the interrupt response from the cpu is going to be small and
>>>> deterministic - but it still varies.
>>>
>>> The interrupt latency on an ARM Cortex M3 is guaranteed to be exactly 12
>>> cycles when coming from mainline code, and 8 cycles when coming from a
>>> lower-priority ISR.  (There are caveats on this in the ARM docs, but
>>> we've found it to be so in practical cases.)
>>
>> No, that is not the case.  Look it up in the docs.
>>
>> 12 cycles is the nominal latency - but it can be greater due to wait
>> states or other complications.  Faster Cortex M devices usually always
>> have wait states on flash if your code (and interrupt vectors) are not
>> in the flash pre-fetch buffers.  
> 
> reading from flash should be possible in parallel with the registers being pushed on the stack, so there should 12 cycles to fetch a vector and then 
> the first interrupt instruction
> 

It might be - that depends on the details of the chip (the flash
controller is not part of the Cortex specifications).  But it might not
be possible, or it might still be delayed while reading the interrupt
vector.  There are many possibilities - the Cortex documents guarantee
the response time when everything else is perfect and there are no other
delays.  People looking for the minimum jitter and latency on these
sorts of devices make a point of having the interrupt vectors and
interrupt code in ram, not flash (and in a separate ram block from the
stack) precisely to avoid this sort of uncertainty.

When you want to be sure about such timings, you need to look at all the
parts and /know/ how they fit together - you don't just look at one
part, guess the rest, and do some timing tests.  The sensible and
practical thing is to look at worst case possibilities, and add them up
with conservative estimates and margins to account for future changes to
the code - and then you see if that is within your specifications.  If
it is good enough, great.  If not, you use the features the chip
manufacturers gave you precisely so that you don't need to be obsessive
about timing cycles in interrupts.

[toc] | [prev] | [next] | [standalone]


#482444

Fromupsidedown@downunder.com
Date2017-10-22 15:40 +0300
Message-ID<i63puc1s6il3733a2o8uvdv8m9qls2sbt0@4ax.com>
In reply to#482387
On Sat, 21 Oct 2017 15:01:49 -0400, rickman <gnuarm@gmail.com> wrote:

>John Larkin wrote on 10/21/2017 1:03 PM:
>> I have the book:
>>
>> https://www.amazon.com/Signals-Systems-Dummies-Mark-Wickert/dp/111847581X/ref=sr_1_1?ie=UTF8&qid=1508604326&sr=8-1&keywords=signals+systems+dummies
>>
>>
>> Here's my DDS sim. A tiny ARM cpu generates a DDS sine wave in
>> software, with a 50 KHz interrupt rate and its internal 10 bit DAC.
>> The spice sim uses a sample+hold and quantizer to simulate that.
>>
>> When V4 is around 400 Hz, the output looks really nice. At, say, 5377
>> Hz, you can zoom in on the voltage peaks and see them getting ragged.
>> The FFT shows the corresponding sidebands around 50 KHz.
>>
>> This stuff is fun, in a geeky sort of way. Better than working on the
>> deck.
>>
>> The filter was made from parts that were already on the pcb BOM; it's
>> not bad.
>
>Driving timing from an interrupt can add jitter.  Better to use a part with 
>DMA driving the ADC.  The the software timing only needs to keep up with the 
>data rate keeping the DMA buffer full.  The only jitter will be from the 
>actual clock and not any clock cycle level jitter in the CPU.

So you intend to use a possibly interrupt to precalculate one or more
samples (phase accumulator update, sine look-up etc.) into a memory
buffer and then let a DMA transfer multiple samples from that memory
buffer  to the DAC.

Precalculating multiple samples during a single interrupt saves on
interrupt overhead, but how do you synchronize DMA transfers with
interrupts ?

Of course, if the frequency is not changing rapidly, you could
precalculate the samples even with some scripting language :-) The
buffer might be quite big to avoid jumps, when the sequence starts
over.

It would be simpler to use a common clock to drive both the interrupt
pin and DAC latch pin. While  there will be added jitter due to
interrupts, but as long as the next sample value can be calculated
prior to the _next_ DAC clock transition, the timing remains perfect.
  

[toc] | [prev] | [next] | [standalone]


#482526

FromDavid Brown <david.brown@hesbynett.no>
Date2017-10-23 13:09 +0200
Message-ID<oskikf$u9s$1@dont-email.me>
In reply to#482444
On 22/10/17 14:40, upsidedown@downunder.com wrote:
> On Sat, 21 Oct 2017 15:01:49 -0400, rickman <gnuarm@gmail.com> wrote:
> 
>> John Larkin wrote on 10/21/2017 1:03 PM:
>>> I have the book:
>>>
>>> https://www.amazon.com/Signals-Systems-Dummies-Mark-Wickert/dp/111847581X/ref=sr_1_1?ie=UTF8&qid=1508604326&sr=8-1&keywords=signals+systems+dummies
>>>
>>>
>>> Here's my DDS sim. A tiny ARM cpu generates a DDS sine wave in
>>> software, with a 50 KHz interrupt rate and its internal 10 bit DAC.
>>> The spice sim uses a sample+hold and quantizer to simulate that.
>>>
>>> When V4 is around 400 Hz, the output looks really nice. At, say, 5377
>>> Hz, you can zoom in on the voltage peaks and see them getting ragged.
>>> The FFT shows the corresponding sidebands around 50 KHz.
>>>
>>> This stuff is fun, in a geeky sort of way. Better than working on the
>>> deck.
>>>
>>> The filter was made from parts that were already on the pcb BOM; it's
>>> not bad.
>>
>> Driving timing from an interrupt can add jitter.  Better to use a part with 
>> DMA driving the ADC.  The the software timing only needs to keep up with the 
>> data rate keeping the DMA buffer full.  The only jitter will be from the 
>> actual clock and not any clock cycle level jitter in the CPU.
> 
> So you intend to use a possibly interrupt to precalculate one or more
> samples (phase accumulator update, sine look-up etc.) into a memory
> buffer and then let a DMA transfer multiple samples from that memory
> buffer  to the DAC.
> 
> Precalculating multiple samples during a single interrupt saves on
> interrupt overhead, but how do you synchronize DMA transfers with
> interrupts ?

It is all quite simple.  Set up a cyclic DMA buffer.  Have a hardware
timer trigger this at regular intervals to take the next value from the
buffer and pass it on to the DAC.  In your main code, or software timer,
or whatever, you regularly check the level of the DMA buffer.  If it is
running low, fill it up with some more samples.  The bigger your buffer,
the more efficient this will be and the less timing pressure there is on
the code (which can then have tight timing for communication, user
interface, or whatever) - but that also means slower reaction times when
you need to change the frequency, amplitude, or phase.

I had a system set up for a project with four independent sine waves of
fixed frequency (1250 Hz, IIRC) via an SPI DAC.  Samples were at about
80 kHz per channel (320 kHz total), with outputs with varying amplitude
and phase.  There were no interrupts, and no processor usage after setup
- it all ran from DMAs, with jitter within a clock cycle or two.  It
just took a few processor instructions to change the phase or amplitude
of a wave.

> 
> Of course, if the frequency is not changing rapidly, you could
> precalculate the samples even with some scripting language :-) The
> buffer might be quite big to avoid jumps, when the sequence starts
> over.
> 
> It would be simpler to use a common clock to drive both the interrupt
> pin and DAC latch pin. While  there will be added jitter due to
> interrupts, but as long as the next sample value can be calculated
> prior to the _next_ DAC clock transition, the timing remains perfect.
>   
> 

[toc] | [prev] | [next] | [standalone]


#482549

FromJan Panteltje <pNaOnStPeAlMtje@yahoo.com>
Date2017-10-23 16:24 +0000
Message-ID<osl54q$ete$1@news.datemas.de>
In reply to#482526
On a sunny day (Mon, 23 Oct 2017 13:09:02 +0200) it happened David Brown
<david.brown@hesbynett.no> wrote in <oskikf$u9s$1@dont-email.me>:

>> 
>> Of course, if the frequency is not changing rapidly, you could
>> precalculate the samples even with some scripting language :-) The
>> buffer might be quite big to avoid jumps, when the sequence starts
>> over.
>> 
>> It would be simpler to use a common clock to drive both the interrupt
>> pin and DAC latch pin. While  there will be added jitter due to
>> interrupts, but as long as the next sample value can be calculated
>> prior to the _next_ DAC clock transition, the timing remains perfect.

There are many ways to skin a cat.
Here I use a 4 kB FIFO buffer on a Raspberry Pi to constantly output DVB-S 8 bits.
The raspi can multitask and just do a lot of other things.
Only 2 chips OK?
 http://panteltje.com/panteltje/raspberry_pi_dvb-s_transmitter/Raspberry_Pi_DVB-S_transmitter_block_diagram_IMG_3958.JPG
buffer is refilled to full anytime the raspi sees the 'half full flag' from the chips.
The buffer is clocked at a constant rate (crystal).
Continuity and low jitter is essential in DVB.
I am not 100% sure why one should always spare on chips, especially for test equipment.
Hardware is cheap, having some flexibility is nice so you can write the code you want.
If you sell your stuff for > 1k $ then 4 $ chips makes no difference.

Am I missing something?
Do not lot of FPGAs with build in ARM core also have FIFO memory?

Code is also on the above link.

?

[toc] | [prev] | [next] | [standalone]


#482582

Frombitrex <bitrex@de.lete.earthlink.net>
Date2017-10-23 15:44 -0400
Message-ID<8ErHB.43463$kA2.21368@fx39.iad>
In reply to#482549
On 10/23/2017 12:24 PM, Jan Panteltje wrote:
> On a sunny day (Mon, 23 Oct 2017 13:09:02 +0200) it happened David Brown
> <david.brown@hesbynett.no> wrote in <oskikf$u9s$1@dont-email.me>:
> 
>>>
>>> Of course, if the frequency is not changing rapidly, you could
>>> precalculate the samples even with some scripting language :-) The
>>> buffer might be quite big to avoid jumps, when the sequence starts
>>> over.
>>>
>>> It would be simpler to use a common clock to drive both the interrupt
>>> pin and DAC latch pin. While  there will be added jitter due to
>>> interrupts, but as long as the next sample value can be calculated
>>> prior to the _next_ DAC clock transition, the timing remains perfect.
> 
> There are many ways to skin a cat.
> Here I use a 4 kB FIFO buffer on a Raspberry Pi to constantly output DVB-S 8 bits.
> The raspi can multitask and just do a lot of other things.
> Only 2 chips OK?
>   http://panteltje.com/panteltje/raspberry_pi_dvb-s_transmitter/Raspberry_Pi_DVB-S_transmitter_block_diagram_IMG_3958.JPG
> buffer is refilled to full anytime the raspi sees the 'half full flag' from the chips.
> The buffer is clocked at a constant rate (crystal).
> Continuity and low jitter is essential in DVB.
> I am not 100% sure why one should always spare on chips, especially for test equipment.
> Hardware is cheap, having some flexibility is nice so you can write the code you want.
> If you sell your stuff for > 1k $ then 4 $ chips makes no difference.
> 
> Am I missing something?
> Do not lot of FPGAs with build in ARM core also have FIFO memory?
> 
> Code is also on the above link.
> 
> ?
> 

I need to do something similar to that but with an 8 bit uP off an 
SDcard, for audio.

Think it would be fast enough to send 16 bit 22kHz audio to a DAC using 
the 'half-full' method using say 1k of internal SRAM as the buffer?

[toc] | [prev] | [next] | [standalone]


#482654

FromJan Panteltje <pNaOnStPeAlMtje@yahoo.com>
Date2017-10-24 09:43 +0000
Message-ID<osn1vm$349$1@news.datemas.de>
In reply to#482582
On a sunny day (Mon, 23 Oct 2017 15:44:04 -0400) it happened bitrex
<bitrex@de.lete.earthlink.net> wrote in <8ErHB.43463$kA2.21368@fx39.iad>:

>On 10/23/2017 12:24 PM, Jan Panteltje wrote:
>> On a sunny day (Mon, 23 Oct 2017 13:09:02 +0200) it happened David Brown
>> <david.brown@hesbynett.no> wrote in <oskikf$u9s$1@dont-email.me>:
>> 
>>>>
>>>> Of course, if the frequency is not changing rapidly, you could
>>>> precalculate the samples even with some scripting language :-) The
>>>> buffer might be quite big to avoid jumps, when the sequence starts
>>>> over.
>>>>
>>>> It would be simpler to use a common clock to drive both the interrupt
>>>> pin and DAC latch pin. While  there will be added jitter due to
>>>> interrupts, but as long as the next sample value can be calculated
>>>> prior to the _next_ DAC clock transition, the timing remains perfect.
>> 
>> There are many ways to skin a cat.
>> Here I use a 4 kB FIFO buffer on a Raspberry Pi to constantly output DVB-S 8 bits.
>> The raspi can multitask and just do a lot of other things.
>> Only 2 chips OK?
>>   http://panteltje.com/panteltje/raspberry_pi_dvb-s_transmitter/Raspberry_Pi_DVB-S_transmitter_block_diagram_IMG_3958.JPG
>> buffer is refilled to full anytime the raspi sees the 'half full flag' from the chips.
>> The buffer is clocked at a constant rate (crystal).
>> Continuity and low jitter is essential in DVB.
>> I am not 100% sure why one should always spare on chips, especially for test equipment.
>> Hardware is cheap, having some flexibility is nice so you can write the code you want.
>> If you sell your stuff for > 1k $ then 4 $ chips makes no difference.
>> 
>> Am I missing something?
>> Do not lot of FPGAs with build in ARM core also have FIFO memory?
>> 
>> Code is also on the above link.
>> 
>> ?
>> 
>
>I need to do something similar to that but with an 8 bit uP off an 
>SDcard, for audio.
>
>Think it would be fast enough to send 16 bit 22kHz audio to a DAC using 
>the 'half-full' method using say 1k of internal SRAM as the buffer?

SRAM is not the same as FIFO.
If you use a circular buffer and use an interupt at 44 kHz to send data from an 8 bit SRAM to the DAC,
it could work.

I have done lower sample rate audio with just a PIC using the PWM output,
so no DAC needed:
 http://panteltje.com/panteltje/pic/audio_pic/




With an external  FIFO however
16 bit, is 2 bytes in 1/22k seconds = 44000 bytes per second.
Your 1 K = 1024 bytes memory gives you 1024 / 44000 = 0.023273 s or about 23 ms time for your processor to do other things.
It is perhaps just enough to cover the time a Linux taskswitch.
So it depends how fast your processr is, how fast you can read from that SDcard, what else it needs to do.
I would not expect any problems on a normal 8 bit PIC for example.

[toc] | [prev] | [next] | [standalone]


#482561

FromPhil Hobbs <pcdhSpamMeSenseless@electrooptical.net>
Date2017-10-23 13:21 -0400
Message-ID<S62dnYRo__yCuHPEnZ2dnUU7-cXNnZ2d@supernews.com>
In reply to#482526
On 10/23/2017 07:09 AM, David Brown wrote:
> On 22/10/17 14:40, upsidedown@downunder.com wrote:
>> On Sat, 21 Oct 2017 15:01:49 -0400, rickman <gnuarm@gmail.com> wrote:
>>
>>> John Larkin wrote on 10/21/2017 1:03 PM:
>>>> I have the book:
>>>>
>>>> https://www.amazon.com/Signals-Systems-Dummies-Mark-Wickert/dp/111847581X/ref=sr_1_1?ie=UTF8&qid=1508604326&sr=8-1&keywords=signals+systems+dummies
>>>>
>>>>
>>>> Here's my DDS sim. A tiny ARM cpu generates a DDS sine wave in
>>>> software, with a 50 KHz interrupt rate and its internal 10 bit DAC.
>>>> The spice sim uses a sample+hold and quantizer to simulate that.
>>>>
>>>> When V4 is around 400 Hz, the output looks really nice. At, say, 5377
>>>> Hz, you can zoom in on the voltage peaks and see them getting ragged.
>>>> The FFT shows the corresponding sidebands around 50 KHz.
>>>>
>>>> This stuff is fun, in a geeky sort of way. Better than working on the
>>>> deck.
>>>>
>>>> The filter was made from parts that were already on the pcb BOM; it's
>>>> not bad.
>>>
>>> Driving timing from an interrupt can add jitter.  Better to use a part with 
>>> DMA driving the ADC.  The the software timing only needs to keep up with the 
>>> data rate keeping the DMA buffer full.  The only jitter will be from the 
>>> actual clock and not any clock cycle level jitter in the CPU.
>>
>> So you intend to use a possibly interrupt to precalculate one or more
>> samples (phase accumulator update, sine look-up etc.) into a memory
>> buffer and then let a DMA transfer multiple samples from that memory
>> buffer  to the DAC.
>>
>> Precalculating multiple samples during a single interrupt saves on
>> interrupt overhead, but how do you synchronize DMA transfers with
>> interrupts ?
> 
> It is all quite simple.  Set up a cyclic DMA buffer.  Have a hardware
> timer trigger this at regular intervals to take the next value from the
> buffer and pass it on to the DAC.  In your main code, or software timer,
> or whatever, you regularly check the level of the DMA buffer.  If it is
> running low, fill it up with some more samples.  The bigger your buffer,
> the more efficient this will be and the less timing pressure there is on
> the code (which can then have tight timing for communication, user
> interface, or whatever) - but that also means slower reaction times when
> you need to change the frequency, amplitude, or phase.
> 
> I had a system set up for a project with four independent sine waves of
> fixed frequency (1250 Hz, IIRC) via an SPI DAC.  Samples were at about
> 80 kHz per channel (320 kHz total), with outputs with varying amplitude
> and phase.  There were no interrupts, and no processor usage after setup
> - it all ran from DMAs, with jitter within a clock cycle or two.  It
> just took a few processor instructions to change the phase or amplitude
> of a wave.
> 
>>
>> Of course, if the frequency is not changing rapidly, you could
>> precalculate the samples even with some scripting language :-) The
>> buffer might be quite big to avoid jumps, when the sequence starts
>> over.
>>
>> It would be simpler to use a common clock to drive both the interrupt
>> pin and DAC latch pin. While  there will be added jitter due to
>> interrupts, but as long as the next sample value can be calculated
>> prior to the _next_ DAC clock transition, the timing remains perfect.
>>   
>>
> 
I didn't know DMA controllers could handle ring buffers.  Can ARM Cortexes?

Cheers

Phil Hobbs

-- 
Dr Philip C D Hobbs
Principal Consultant
ElectroOptical Innovations LLC
Optics, Electro-optics, Photonics, Analog Electronics

160 North State Road #203
Briarcliff Manor NY 10510

hobbs at electrooptical dot net
http://electrooptical.net

[toc] | [prev] | [next] | [standalone]


#482570

FromJohn Devereux <john@devereux.me.uk>
Date2017-10-23 19:40 +0100
Message-ID<877evlu2ri.fsf@devereux.me.uk>
In reply to#482561
Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> writes:

> On 10/23/2017 07:09 AM, David Brown wrote:
>> On 22/10/17 14:40, upsidedown@downunder.com wrote:
>>> On Sat, 21 Oct 2017 15:01:49 -0400, rickman <gnuarm@gmail.com> wrote:
>>>
>>>> John Larkin wrote on 10/21/2017 1:03 PM:
>>>>> I have the book:
>>>>>
>>>>> https://www.amazon.com/Signals-Systems-Dummies-Mark-Wickert/dp/111847581X/ref=sr_1_1?ie=UTF8&qid=1508604326&sr=8-1&keywords=signals+systems+dummies
>>>>>
>>>>>
>>>>> Here's my DDS sim. A tiny ARM cpu generates a DDS sine wave in
>>>>> software, with a 50 KHz interrupt rate and its internal 10 bit DAC.
>>>>> The spice sim uses a sample+hold and quantizer to simulate that.
>>>>>
>>>>> When V4 is around 400 Hz, the output looks really nice. At, say, 5377
>>>>> Hz, you can zoom in on the voltage peaks and see them getting ragged.
>>>>> The FFT shows the corresponding sidebands around 50 KHz.
>>>>>
>>>>> This stuff is fun, in a geeky sort of way. Better than working on the
>>>>> deck.
>>>>>
>>>>> The filter was made from parts that were already on the pcb BOM; it's
>>>>> not bad.
>>>>
>>>> Driving timing from an interrupt can add jitter.  Better to use a part with 
>>>> DMA driving the ADC.  The the software timing only needs to keep up with the 
>>>> data rate keeping the DMA buffer full.  The only jitter will be from the 
>>>> actual clock and not any clock cycle level jitter in the CPU.
>>>
>>> So you intend to use a possibly interrupt to precalculate one or more
>>> samples (phase accumulator update, sine look-up etc.) into a memory
>>> buffer and then let a DMA transfer multiple samples from that memory
>>> buffer  to the DAC.
>>>
>>> Precalculating multiple samples during a single interrupt saves on
>>> interrupt overhead, but how do you synchronize DMA transfers with
>>> interrupts ?
>> 
>> It is all quite simple.  Set up a cyclic DMA buffer.  Have a hardware
>> timer trigger this at regular intervals to take the next value from the
>> buffer and pass it on to the DAC.  In your main code, or software timer,
>> or whatever, you regularly check the level of the DMA buffer.  If it is
>> running low, fill it up with some more samples.  The bigger your buffer,
>> the more efficient this will be and the less timing pressure there is on
>> the code (which can then have tight timing for communication, user
>> interface, or whatever) - but that also means slower reaction times when
>> you need to change the frequency, amplitude, or phase.
>> 
>> I had a system set up for a project with four independent sine waves of
>> fixed frequency (1250 Hz, IIRC) via an SPI DAC.  Samples were at about
>> 80 kHz per channel (320 kHz total), with outputs with varying amplitude
>> and phase.  There were no interrupts, and no processor usage after setup
>> - it all ran from DMAs, with jitter within a clock cycle or two.  It
>> just took a few processor instructions to change the phase or amplitude
>> of a wave.
>> 
>>>
>>> Of course, if the frequency is not changing rapidly, you could
>>> precalculate the samples even with some scripting language :-) The
>>> buffer might be quite big to avoid jumps, when the sequence starts
>>> over.
>>>
>>> It would be simpler to use a common clock to drive both the interrupt
>>> pin and DAC latch pin. While  there will be added jitter due to
>>> interrupts, but as long as the next sample value can be calculated
>>> prior to the _next_ DAC clock transition, the timing remains perfect.
>>>   
>>>
>> 
> I didn't know DMA controllers could handle ring buffers.  Can ARM Cortexes?

I don't know if they all use the same DMA hardware, I would have assumed
not. But STM32 can do a DMA ring buffer - "circular mode". I have used
it for acquiring samples from a 2MHz external serial ADC with no breaks
in the data, works fine. It can also alternate between two buffers IIRC
to get a similar effect.


-- 

John Devereux

[toc] | [prev] | [next] | [standalone]


#482584

FromPhil Hobbs <pcdhSpamMeSenseless@electrooptical.net>
Date2017-10-23 15:46 -0400
Message-ID<M62dnZax-Lmt2nPEnZ2dnUU7-TWdnZ2d@supernews.com>
In reply to#482570
On 10/23/2017 02:40 PM, John Devereux wrote:
> Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> writes:
> 
>> On 10/23/2017 07:09 AM, David Brown wrote:
>>> On 22/10/17 14:40, upsidedown@downunder.com wrote:
>>>> On Sat, 21 Oct 2017 15:01:49 -0400, rickman <gnuarm@gmail.com> wrote:
>>>>
>>>>> John Larkin wrote on 10/21/2017 1:03 PM:
>>>>>> I have the book:
>>>>>>
>>>>>> https://www.amazon.com/Signals-Systems-Dummies-Mark-Wickert/dp/111847581X/ref=sr_1_1?ie=UTF8&qid=1508604326&sr=8-1&keywords=signals+systems+dummies
>>>>>>
>>>>>>
>>>>>> Here's my DDS sim. A tiny ARM cpu generates a DDS sine wave in
>>>>>> software, with a 50 KHz interrupt rate and its internal 10 bit DAC.
>>>>>> The spice sim uses a sample+hold and quantizer to simulate that.
>>>>>>
>>>>>> When V4 is around 400 Hz, the output looks really nice. At, say, 5377
>>>>>> Hz, you can zoom in on the voltage peaks and see them getting ragged.
>>>>>> The FFT shows the corresponding sidebands around 50 KHz.
>>>>>>
>>>>>> This stuff is fun, in a geeky sort of way. Better than working on the
>>>>>> deck.
>>>>>>
>>>>>> The filter was made from parts that were already on the pcb BOM; it's
>>>>>> not bad.
>>>>>
>>>>> Driving timing from an interrupt can add jitter.  Better to use a part with 
>>>>> DMA driving the ADC.  The the software timing only needs to keep up with the 
>>>>> data rate keeping the DMA buffer full.  The only jitter will be from the 
>>>>> actual clock and not any clock cycle level jitter in the CPU.
>>>>
>>>> So you intend to use a possibly interrupt to precalculate one or more
>>>> samples (phase accumulator update, sine look-up etc.) into a memory
>>>> buffer and then let a DMA transfer multiple samples from that memory
>>>> buffer  to the DAC.
>>>>
>>>> Precalculating multiple samples during a single interrupt saves on
>>>> interrupt overhead, but how do you synchronize DMA transfers with
>>>> interrupts ?
>>>
>>> It is all quite simple.  Set up a cyclic DMA buffer.  Have a hardware
>>> timer trigger this at regular intervals to take the next value from the
>>> buffer and pass it on to the DAC.  In your main code, or software timer,
>>> or whatever, you regularly check the level of the DMA buffer.  If it is
>>> running low, fill it up with some more samples.  The bigger your buffer,
>>> the more efficient this will be and the less timing pressure there is on
>>> the code (which can then have tight timing for communication, user
>>> interface, or whatever) - but that also means slower reaction times when
>>> you need to change the frequency, amplitude, or phase.
>>>
>>> I had a system set up for a project with four independent sine waves of
>>> fixed frequency (1250 Hz, IIRC) via an SPI DAC.  Samples were at about
>>> 80 kHz per channel (320 kHz total), with outputs with varying amplitude
>>> and phase.  There were no interrupts, and no processor usage after setup
>>> - it all ran from DMAs, with jitter within a clock cycle or two.  It
>>> just took a few processor instructions to change the phase or amplitude
>>> of a wave.
>>>
>>>>
>>>> Of course, if the frequency is not changing rapidly, you could
>>>> precalculate the samples even with some scripting language :-) The
>>>> buffer might be quite big to avoid jumps, when the sequence starts
>>>> over.
>>>>
>>>> It would be simpler to use a common clock to drive both the interrupt
>>>> pin and DAC latch pin. While  there will be added jitter due to
>>>> interrupts, but as long as the next sample value can be calculated
>>>> prior to the _next_ DAC clock transition, the timing remains perfect.
>>>>   
>>>>
>>>
>> I didn't know DMA controllers could handle ring buffers.  Can ARM Cortexes?
> 
> I don't know if they all use the same DMA hardware, I would have assumed
> not. But STM32 can do a DMA ring buffer - "circular mode". I have used
> it for acquiring samples from a 2MHz external serial ADC with no breaks
> in the data, works fine. It can also alternate between two buffers IIRC
> to get a similar effect.
> 
>  
Ping-ponging I know about, but being able to have jitter-free output
sequences of any length just by keeping the buffer from going empty
would be pretty cool.

Otherwise it's hard to avoid jitter at the end of each DMA sequence, no?

Cheers

Phil Hobbs

-- 
Dr Philip C D Hobbs
Principal Consultant
ElectroOptical Innovations LLC
Optics, Electro-optics, Photonics, Analog Electronics

160 North State Road #203
Briarcliff Manor NY 10510

hobbs at electrooptical dot net
http://electrooptical.net

[toc] | [prev] | [next] | [standalone]


#482606

FromKlaus Kragelund <klauskvik@hotmail.com>
Date2017-10-23 18:10 -0700
Message-ID<bdc0cdee-229b-4b9a-b543-fea80340fbb9@googlegroups.com>
In reply to#482584
On Monday, October 23, 2017 at 9:47:05 PM UTC+2, Phil Hobbs wrote:
> On 10/23/2017 02:40 PM, John Devereux wrote:
> > Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> writes:
> > 
> >> On 10/23/2017 07:09 AM, David Brown wrote:
> >>> On 22/10/17 14:40, upsidedown@downunder.com wrote:
> >>>> On Sat, 21 Oct 2017 15:01:49 -0400, rickman <gnuarm@gmail.com> wrote:
> >>>>
> >>>>> John Larkin wrote on 10/21/2017 1:03 PM:
> >>>>>> I have the book:
> >>>>>>
> >>>>>> https://www.amazon.com/Signals-Systems-Dummies-Mark-Wickert/dp/111847581X/ref=sr_1_1?ie=UTF8&qid=1508604326&sr=8-1&keywords=signals+systems+dummies
> >>>>>>
> >>>>>>
> >>>>>> Here's my DDS sim. A tiny ARM cpu generates a DDS sine wave in
> >>>>>> software, with a 50 KHz interrupt rate and its internal 10 bit DAC.
> >>>>>> The spice sim uses a sample+hold and quantizer to simulate that.
> >>>>>>
> >>>>>> When V4 is around 400 Hz, the output looks really nice. At, say, 5377
> >>>>>> Hz, you can zoom in on the voltage peaks and see them getting ragged.
> >>>>>> The FFT shows the corresponding sidebands around 50 KHz.
> >>>>>>
> >>>>>> This stuff is fun, in a geeky sort of way. Better than working on the
> >>>>>> deck.
> >>>>>>
> >>>>>> The filter was made from parts that were already on the pcb BOM; it's
> >>>>>> not bad.
> >>>>>
> >>>>> Driving timing from an interrupt can add jitter.  Better to use a part with 
> >>>>> DMA driving the ADC.  The the software timing only needs to keep up with the 
> >>>>> data rate keeping the DMA buffer full.  The only jitter will be from the 
> >>>>> actual clock and not any clock cycle level jitter in the CPU.
> >>>>
> >>>> So you intend to use a possibly interrupt to precalculate one or more
> >>>> samples (phase accumulator update, sine look-up etc.) into a memory
> >>>> buffer and then let a DMA transfer multiple samples from that memory
> >>>> buffer  to the DAC.
> >>>>
> >>>> Precalculating multiple samples during a single interrupt saves on
> >>>> interrupt overhead, but how do you synchronize DMA transfers with
> >>>> interrupts ?
> >>>
> >>> It is all quite simple.  Set up a cyclic DMA buffer.  Have a hardware
> >>> timer trigger this at regular intervals to take the next value from the
> >>> buffer and pass it on to the DAC.  In your main code, or software timer,
> >>> or whatever, you regularly check the level of the DMA buffer.  If it is
> >>> running low, fill it up with some more samples.  The bigger your buffer,
> >>> the more efficient this will be and the less timing pressure there is on
> >>> the code (which can then have tight timing for communication, user
> >>> interface, or whatever) - but that also means slower reaction times when
> >>> you need to change the frequency, amplitude, or phase.
> >>>
> >>> I had a system set up for a project with four independent sine waves of
> >>> fixed frequency (1250 Hz, IIRC) via an SPI DAC.  Samples were at about
> >>> 80 kHz per channel (320 kHz total), with outputs with varying amplitude
> >>> and phase.  There were no interrupts, and no processor usage after setup
> >>> - it all ran from DMAs, with jitter within a clock cycle or two.  It
> >>> just took a few processor instructions to change the phase or amplitude
> >>> of a wave.
> >>>
> >>>>
> >>>> Of course, if the frequency is not changing rapidly, you could
> >>>> precalculate the samples even with some scripting language :-) The
> >>>> buffer might be quite big to avoid jumps, when the sequence starts
> >>>> over.
> >>>>
> >>>> It would be simpler to use a common clock to drive both the interrupt
> >>>> pin and DAC latch pin. While  there will be added jitter due to
> >>>> interrupts, but as long as the next sample value can be calculated
> >>>> prior to the _next_ DAC clock transition, the timing remains perfect.
> >>>>   
> >>>>
> >>>
> >> I didn't know DMA controllers could handle ring buffers.  Can ARM Cortexes?
> > 
> > I don't know if they all use the same DMA hardware, I would have assumed
> > not. But STM32 can do a DMA ring buffer - "circular mode". I have used
> > it for acquiring samples from a 2MHz external serial ADC with no breaks
> > in the data, works fine. It can also alternate between two buffers IIRC
> > to get a similar effect.
> > 
> >  
> Ping-ponging I know about, but being able to have jitter-free output
> sequences of any length just by keeping the buffer from going empty
> would be pretty cool.
> 
> Otherwise it's hard to avoid jitter at the end of each DMA sequence, no?
> 
The ARM processors I have used (M0, M0+ and M3) all has circular DMA buffers

It's an obvious application, so I think any decent manufactor is going to add that feature

Cheers

Klaus

[toc] | [prev] | [next] | [standalone]


#483013

FromJohn Devereux <john@devereux.me.uk>
Date2017-10-26 10:41 +0100
Message-ID<87she6b61a.fsf@devereux.me.uk>
In reply to#482584
Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> writes:

> On 10/23/2017 02:40 PM, John Devereux wrote:
>> Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> writes:
>> 
>>> On 10/23/2017 07:09 AM, David Brown wrote:
>>>> On 22/10/17 14:40, upsidedown@downunder.com wrote:
>>>>> On Sat, 21 Oct 2017 15:01:49 -0400, rickman <gnuarm@gmail.com> wrote:
>>>>>
>>>>>> John Larkin wrote on 10/21/2017 1:03 PM:
>>>>>>> I have the book:
>>>>>>>
>>>>>>> https://www.amazon.com/Signals-Systems-Dummies-Mark-Wickert/dp/111847581X/ref=sr_1_1?ie=UTF8&qid=1508604326&sr=8-1&keywords=signals+systems+dummies
>>>>>>>
>>>>>>>
>>>>>>> Here's my DDS sim. A tiny ARM cpu generates a DDS sine wave in
>>>>>>> software, with a 50 KHz interrupt rate and its internal 10 bit DAC.
>>>>>>> The spice sim uses a sample+hold and quantizer to simulate that.
>>>>>>>
>>>>>>> When V4 is around 400 Hz, the output looks really nice. At, say, 5377
>>>>>>> Hz, you can zoom in on the voltage peaks and see them getting ragged.
>>>>>>> The FFT shows the corresponding sidebands around 50 KHz.
>>>>>>>
>>>>>>> This stuff is fun, in a geeky sort of way. Better than working on the
>>>>>>> deck.
>>>>>>>
>>>>>>> The filter was made from parts that were already on the pcb BOM; it's
>>>>>>> not bad.
>>>>>>
>>>>>> Driving timing from an interrupt can add jitter.  Better to use a part with 
>>>>>> DMA driving the ADC.  The the software timing only needs to keep up with the 
>>>>>> data rate keeping the DMA buffer full.  The only jitter will be from the 
>>>>>> actual clock and not any clock cycle level jitter in the CPU.
>>>>>
>>>>> So you intend to use a possibly interrupt to precalculate one or more
>>>>> samples (phase accumulator update, sine look-up etc.) into a memory
>>>>> buffer and then let a DMA transfer multiple samples from that memory
>>>>> buffer  to the DAC.
>>>>>
>>>>> Precalculating multiple samples during a single interrupt saves on
>>>>> interrupt overhead, but how do you synchronize DMA transfers with
>>>>> interrupts ?
>>>>
>>>> It is all quite simple.  Set up a cyclic DMA buffer.  Have a hardware
>>>> timer trigger this at regular intervals to take the next value from the
>>>> buffer and pass it on to the DAC.  In your main code, or software timer,
>>>> or whatever, you regularly check the level of the DMA buffer.  If it is
>>>> running low, fill it up with some more samples.  The bigger your buffer,
>>>> the more efficient this will be and the less timing pressure there is on
>>>> the code (which can then have tight timing for communication, user
>>>> interface, or whatever) - but that also means slower reaction times when
>>>> you need to change the frequency, amplitude, or phase.
>>>>
>>>> I had a system set up for a project with four independent sine waves of
>>>> fixed frequency (1250 Hz, IIRC) via an SPI DAC.  Samples were at about
>>>> 80 kHz per channel (320 kHz total), with outputs with varying amplitude
>>>> and phase.  There were no interrupts, and no processor usage after setup
>>>> - it all ran from DMAs, with jitter within a clock cycle or two.  It
>>>> just took a few processor instructions to change the phase or amplitude
>>>> of a wave.
>>>>
>>>>>
>>>>> Of course, if the frequency is not changing rapidly, you could
>>>>> precalculate the samples even with some scripting language :-) The
>>>>> buffer might be quite big to avoid jumps, when the sequence starts
>>>>> over.
>>>>>
>>>>> It would be simpler to use a common clock to drive both the interrupt
>>>>> pin and DAC latch pin. While  there will be added jitter due to
>>>>> interrupts, but as long as the next sample value can be calculated
>>>>> prior to the _next_ DAC clock transition, the timing remains perfect.
>>>>>   
>>>>>
>>>>
>>> I didn't know DMA controllers could handle ring buffers.  Can ARM Cortexes?
>> 
>> I don't know if they all use the same DMA hardware, I would have assumed
>> not. But STM32 can do a DMA ring buffer - "circular mode". I have used
>> it for acquiring samples from a 2MHz external serial ADC with no breaks
>> in the data, works fine. It can also alternate between two buffers IIRC
>> to get a similar effect.
>> 
>>  
> Ping-ponging I know about, but being able to have jitter-free output
> sequences of any length just by keeping the buffer from going empty
> would be pretty cool.

AFAIK you can, but I have not actually tried it for output.

> Otherwise it's hard to avoid jitter at the end of each DMA sequence,
> no?

Well the "ping-pong" is in hardware. So I don't see that there is any
fundamental difference between the memory pointer being switched to
another buffer, or to the start of the same buffer.

For output from a circular buffer you have to make sure your software
stays ahead of the DMA pointer. For the ping-pong... it's the same,
really. But it is probably slightly easier to write the software, or at
least easier to think about. Since you don't have to be doing modulo N
all the time for the accesses.


-- 

John Devereux

[toc] | [prev] | [next] | [standalone]


#483027

FromPhil Hobbs <pcdhSpamMeSenseless@electrooptical.net>
Date2017-10-26 10:52 -0400
Message-ID<BJqdnR9-p59Xa2zEnZ2dnUU7-K_NnZ2d@supernews.com>
In reply to#483013
On 10/26/2017 05:41 AM, John Devereux wrote:
> Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> writes:
> 
>> On 10/23/2017 02:40 PM, John Devereux wrote:
>>> Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> writes:
>>>
>>>> On 10/23/2017 07:09 AM, David Brown wrote:
>>>>> On 22/10/17 14:40, upsidedown@downunder.com wrote:
>>>>>> On Sat, 21 Oct 2017 15:01:49 -0400, rickman <gnuarm@gmail.com> wrote:
>>>>>>
>>>>>>> John Larkin wrote on 10/21/2017 1:03 PM:
>>>>>>>> I have the book:
>>>>>>>>
>>>>>>>> https://www.amazon.com/Signals-Systems-Dummies-Mark-Wickert/dp/111847581X/ref=sr_1_1?ie=UTF8&qid=1508604326&sr=8-1&keywords=signals+systems+dummies
>>>>>>>>
>>>>>>>>
>>>>>>>> Here's my DDS sim. A tiny ARM cpu generates a DDS sine wave in
>>>>>>>> software, with a 50 KHz interrupt rate and its internal 10 bit DAC.
>>>>>>>> The spice sim uses a sample+hold and quantizer to simulate that.
>>>>>>>>
>>>>>>>> When V4 is around 400 Hz, the output looks really nice. At, say, 5377
>>>>>>>> Hz, you can zoom in on the voltage peaks and see them getting ragged.
>>>>>>>> The FFT shows the corresponding sidebands around 50 KHz.
>>>>>>>>
>>>>>>>> This stuff is fun, in a geeky sort of way. Better than working on the
>>>>>>>> deck.
>>>>>>>>
>>>>>>>> The filter was made from parts that were already on the pcb BOM; it's
>>>>>>>> not bad.
>>>>>>>
>>>>>>> Driving timing from an interrupt can add jitter.  Better to use a part with 
>>>>>>> DMA driving the ADC.  The the software timing only needs to keep up with the 
>>>>>>> data rate keeping the DMA buffer full.  The only jitter will be from the 
>>>>>>> actual clock and not any clock cycle level jitter in the CPU.
>>>>>>
>>>>>> So you intend to use a possibly interrupt to precalculate one or more
>>>>>> samples (phase accumulator update, sine look-up etc.) into a memory
>>>>>> buffer and then let a DMA transfer multiple samples from that memory
>>>>>> buffer  to the DAC.
>>>>>>
>>>>>> Precalculating multiple samples during a single interrupt saves on
>>>>>> interrupt overhead, but how do you synchronize DMA transfers with
>>>>>> interrupts ?
>>>>>
>>>>> It is all quite simple.  Set up a cyclic DMA buffer.  Have a hardware
>>>>> timer trigger this at regular intervals to take the next value from the
>>>>> buffer and pass it on to the DAC.  In your main code, or software timer,
>>>>> or whatever, you regularly check the level of the DMA buffer.  If it is
>>>>> running low, fill it up with some more samples.  The bigger your buffer,
>>>>> the more efficient this will be and the less timing pressure there is on
>>>>> the code (which can then have tight timing for communication, user
>>>>> interface, or whatever) - but that also means slower reaction times when
>>>>> you need to change the frequency, amplitude, or phase.
>>>>>
>>>>> I had a system set up for a project with four independent sine waves of
>>>>> fixed frequency (1250 Hz, IIRC) via an SPI DAC.  Samples were at about
>>>>> 80 kHz per channel (320 kHz total), with outputs with varying amplitude
>>>>> and phase.  There were no interrupts, and no processor usage after setup
>>>>> - it all ran from DMAs, with jitter within a clock cycle or two.  It
>>>>> just took a few processor instructions to change the phase or amplitude
>>>>> of a wave.
>>>>>
>>>>>>
>>>>>> Of course, if the frequency is not changing rapidly, you could
>>>>>> precalculate the samples even with some scripting language :-) The
>>>>>> buffer might be quite big to avoid jumps, when the sequence starts
>>>>>> over.
>>>>>>
>>>>>> It would be simpler to use a common clock to drive both the interrupt
>>>>>> pin and DAC latch pin. While  there will be added jitter due to
>>>>>> interrupts, but as long as the next sample value can be calculated
>>>>>> prior to the _next_ DAC clock transition, the timing remains perfect.
>>>>>>   
>>>>>>
>>>>>
>>>> I didn't know DMA controllers could handle ring buffers.  Can ARM Cortexes?
>>>
>>> I don't know if they all use the same DMA hardware, I would have assumed
>>> not. But STM32 can do a DMA ring buffer - "circular mode". I have used
>>> it for acquiring samples from a 2MHz external serial ADC with no breaks
>>> in the data, works fine. It can also alternate between two buffers IIRC
>>> to get a similar effect.
>>>
>>>  
>> Ping-ponging I know about, but being able to have jitter-free output
>> sequences of any length just by keeping the buffer from going empty
>> would be pretty cool.
> 
> AFAIK you can, but I have not actually tried it for output.
> 
>> Otherwise it's hard to avoid jitter at the end of each DMA sequence,
>> no?
> 
> Well the "ping-pong" is in hardware. So I don't see that there is any
> fundamental difference between the memory pointer being switched to
> another buffer, or to the start of the same buffer.
> 
> For output from a circular buffer you have to make sure your software
> stays ahead of the DMA pointer. For the ping-pong... it's the same,
> really. But it is probably slightly easier to write the software, or at
> least easier to think about. Since you don't have to be doing modulo N
> all the time for the accesses.

The win would be to have continuous DMAs to the circular buffer, with
the DMA controller smart enough to manage the write pointer and keep
looping round and round.

Old time FIFO buffer chips had "almost-full" and "almost empty" flags.
BITD I used to use the IDT 7204 to interface flash ADCs to PC parallel
ports, and found its "half-full" flag very handy.

Cheers

Phil Hobbs

-- 
Dr Philip C D Hobbs
Principal Consultant
ElectroOptical Innovations LLC
Optics, Electro-optics, Photonics, Analog Electronics

160 North State Road #203
Briarcliff Manor NY 10510

hobbs at electrooptical dot net
http://electrooptical.net

[toc] | [prev] | [next] | [standalone]


#483085

FromClifford Heath <no.spam@please.net>
Date2017-10-23 08:51 +1100
Message-ID<58tIB.24228$463.12010@fx13.iad>
In reply to#483027
On 27/10/17 01:52, Phil Hobbs wrote:
> On 10/26/2017 05:41 AM, John Devereux wrote:
>> Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> writes:
>>
>>> On 10/23/2017 02:40 PM, John Devereux wrote:
>>>> Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> writes:
>>>>
>>>>> On 10/23/2017 07:09 AM, David Brown wrote:
>>>>>> On 22/10/17 14:40, upsidedown@downunder.com wrote:
>>>>>>> On Sat, 21 Oct 2017 15:01:49 -0400, rickman <gnuarm@gmail.com> wrote:
>>>>>>>
>>>>>>>> John Larkin wrote on 10/21/2017 1:03 PM:
>>>>>>>>> I have the book:
>>>>>>>>>
>>>>>>>>> https://www.amazon.com/Signals-Systems-Dummies-Mark-Wickert/dp/111847581X/ref=sr_1_1?ie=UTF8&qid=1508604326&sr=8-1&keywords=signals+systems+dummies
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Here's my DDS sim. A tiny ARM cpu generates a DDS sine wave in
>>>>>>>>> software, with a 50 KHz interrupt rate and its internal 10 bit DAC.
>>>>>>>>> The spice sim uses a sample+hold and quantizer to simulate that.
>>>>>>>>>
>>>>>>>>> When V4 is around 400 Hz, the output looks really nice. At, say, 5377
>>>>>>>>> Hz, you can zoom in on the voltage peaks and see them getting ragged.
>>>>>>>>> The FFT shows the corresponding sidebands around 50 KHz.
>>>>>>>>>
>>>>>>>>> This stuff is fun, in a geeky sort of way. Better than working on the
>>>>>>>>> deck.
>>>>>>>>>
>>>>>>>>> The filter was made from parts that were already on the pcb BOM; it's
>>>>>>>>> not bad.
>>>>>>>>
>>>>>>>> Driving timing from an interrupt can add jitter.  Better to use a part with
>>>>>>>> DMA driving the ADC.  The the software timing only needs to keep up with the
>>>>>>>> data rate keeping the DMA buffer full.  The only jitter will be from the
>>>>>>>> actual clock and not any clock cycle level jitter in the CPU.
>>>>>>>
>>>>>>> So you intend to use a possibly interrupt to precalculate one or more
>>>>>>> samples (phase accumulator update, sine look-up etc.) into a memory
>>>>>>> buffer and then let a DMA transfer multiple samples from that memory
>>>>>>> buffer  to the DAC.
>>>>>>>
>>>>>>> Precalculating multiple samples during a single interrupt saves on
>>>>>>> interrupt overhead, but how do you synchronize DMA transfers with
>>>>>>> interrupts ?
>>>>>>
>>>>>> It is all quite simple.  Set up a cyclic DMA buffer.  Have a hardware
>>>>>> timer trigger this at regular intervals to take the next value from the
>>>>>> buffer and pass it on to the DAC.  In your main code, or software timer,
>>>>>> or whatever, you regularly check the level of the DMA buffer.  If it is
>>>>>> running low, fill it up with some more samples.  The bigger your buffer,
>>>>>> the more efficient this will be and the less timing pressure there is on
>>>>>> the code (which can then have tight timing for communication, user
>>>>>> interface, or whatever) - but that also means slower reaction times when
>>>>>> you need to change the frequency, amplitude, or phase.
>>>>>>
>>>>>> I had a system set up for a project with four independent sine waves of
>>>>>> fixed frequency (1250 Hz, IIRC) via an SPI DAC.  Samples were at about
>>>>>> 80 kHz per channel (320 kHz total), with outputs with varying amplitude
>>>>>> and phase.  There were no interrupts, and no processor usage after setup
>>>>>> - it all ran from DMAs, with jitter within a clock cycle or two.  It
>>>>>> just took a few processor instructions to change the phase or amplitude
>>>>>> of a wave.
>>>>>>
>>>>>>>
>>>>>>> Of course, if the frequency is not changing rapidly, you could
>>>>>>> precalculate the samples even with some scripting language :-) The
>>>>>>> buffer might be quite big to avoid jumps, when the sequence starts
>>>>>>> over.
>>>>>>>
>>>>>>> It would be simpler to use a common clock to drive both the interrupt
>>>>>>> pin and DAC latch pin. While  there will be added jitter due to
>>>>>>> interrupts, but as long as the next sample value can be calculated
>>>>>>> prior to the _next_ DAC clock transition, the timing remains perfect.
>>>>>>>    
>>>>>>>
>>>>>>
>>>>> I didn't know DMA controllers could handle ring buffers.  Can ARM Cortexes?
>>>>
>>>> I don't know if they all use the same DMA hardware, I would have assumed
>>>> not. But STM32 can do a DMA ring buffer - "circular mode". I have used
>>>> it for acquiring samples from a 2MHz external serial ADC with no breaks
>>>> in the data, works fine. It can also alternate between two buffers IIRC
>>>> to get a similar effect.
>>>>
>>>>   
>>> Ping-ponging I know about, but being able to have jitter-free output
>>> sequences of any length just by keeping the buffer from going empty
>>> would be pretty cool.
>>
>> AFAIK you can, but I have not actually tried it for output.
>>
>>> Otherwise it's hard to avoid jitter at the end of each DMA sequence,
>>> no?
>>
>> Well the "ping-pong" is in hardware. So I don't see that there is any
>> fundamental difference between the memory pointer being switched to
>> another buffer, or to the start of the same buffer.
>>
>> For output from a circular buffer you have to make sure your software
>> stays ahead of the DMA pointer. For the ping-pong... it's the same,
>> really. But it is probably slightly easier to write the software, or at
>> least easier to think about. Since you don't have to be doing modulo N
>> all the time for the accesses.
> 
> The win would be to have continuous DMAs to the circular buffer, with
> the DMA controller smart enough to manage the write pointer and keep
> looping round and round.
> 
> Old time FIFO buffer chips had "almost-full" and "almost empty" flags.
> BITD I used to use the IDT 7204 to interface flash ADCs to PC parallel
> ports, and found its "half-full" flag very handy.

Isn't "half-full" effectively the same as ping-pong in hardware?
AIUI, the STM32 ping-pong DMA automatically switches buffers,
giving you an interrupt to say it did (the "half-full" indication).

Clifford Heath

[toc] | [prev] | [next] | [standalone]


#483088

Frompcdhobbs@gmail.com
Date2017-10-26 16:03 -0700
Message-ID<a39f95c5-e794-469b-b2e0-51a885981e03@googlegroups.com>
In reply to#483085
>Isn't "half-full" effectively the same as ping-pong in hardware? 
>AIUI, the STM32 ping-pong DMA automatically switches buffers, 
>giving you an interrupt to say it did (the "half-full" indication).

Nice that they've caught up with 1990 tech there. ;)

A few years back I had a good look at the STM32s, but the libraries were so horrible that I went back to NXP with my tail between my legs.

It looks like the LPC176x DMA's scatter/gather support can be used to make H/W controlled ring buffers, but we'll see. 

Cheers

Phil Hobbs  

[toc] | [prev] | [next] | [standalone]


#483090

FromClifford Heath <no.spam@please.net>
Date2017-10-27 10:14 +1100
Message-ID<w%tIB.44777$gK1.3923@fx02.iad>
In reply to#483088
On 27/10/17 10:03, pcdhobbs@gmail.com wrote:
>> Isn't "half-full" effectively the same as ping-pong in hardware?
>> AIUI, the STM32 ping-pong DMA automatically switches buffers,
>> giving you an interrupt to say it did (the "half-full" indication).
> 
> Nice that they've caught up with 1990 tech there. ;)

I think double buffering is a fair bit older than that,
but the problem it solves has few alternative solutions.

> A few years back I had a good look at the STM32s,
> but the libraries were so horrible

I avoid manufacturer libraries wherever possible.

> It looks like the LPC176x DMA's scatter/gather support can be used to make H/W controlled ring buffers, but we'll see.

Like readv(2) and writev(2) in hardware - a nice idea.
Let us know how it goes.

Clifford Heath.

[toc] | [prev] | [next] | [standalone]


#483144

FromJohn Devereux <john@devereux.me.uk>
Date2017-10-27 08:28 +0100
Message-ID<87efppt5g6.fsf@devereux.me.uk>
In reply to#483088
pcdhobbs@gmail.com writes:

>>Isn't "half-full" effectively the same as ping-pong in hardware? 
>>AIUI, the STM32 ping-pong DMA automatically switches buffers, 
>>giving you an interrupt to say it did (the "half-full" indication).
>
> Nice that they've caught up with 1990 tech there. ;)
>
> A few years back I had a good look at the STM32s, but the libraries
> were so horrible that I went back to NXP with my tail between my legs.

But that was years ago.

Now they are.... still horrible.


>
> It looks like the LPC176x DMA's scatter/gather support can be used to make H/W controlled ring buffers, but we'll see. 
>
> Cheers
>
> Phil Hobbs  

-- 

John Devereux

[toc] | [prev] | [next] | [standalone]


#483146

FromDavid Brown <david.brown@hesbynett.no>
Date2017-10-27 10:46 +0200
Message-ID<osurp4$653$1@dont-email.me>
In reply to#483144
On 27/10/17 09:28, John Devereux wrote:
> pcdhobbs@gmail.com writes:
> 
>>> Isn't "half-full" effectively the same as ping-pong in hardware? 
>>> AIUI, the STM32 ping-pong DMA automatically switches buffers, 
>>> giving you an interrupt to say it did (the "half-full" indication).
>>
>> Nice that they've caught up with 1990 tech there. ;)
>>
>> A few years back I had a good look at the STM32s, but the libraries
>> were so horrible that I went back to NXP with my tail between my legs.
> 

I haven't used ST's devices, but it never ceases to amaze me how
unpleasant manufacturers' libraries tend to be.  I believe they are
mostly done by a bunch of students as summer jobs or course projects.
These students work independently.  Then they leave, and another bunch
of students get the job of tying them together.  This is topped off by
getting some humanities students to write the documentation.

Underlying all this is usually some startup code that started life in
assembly for a processor that died off two decades ago, and has
gradually morphed to support fifteen architectures and seven different
compilers, making it incomprehensible when all you want is to see the
code for /one/ microcontroller and /one/ compiler.  Of course, it is
impossible to see the original code because it is auto-generated by a
"wizard" - preferably via something online at the manufacturers website.

> But that was years ago.
> 
> Now they are.... still horrible.
> 
> 
>>
>> It looks like the LPC176x DMA's scatter/gather support can be used to make H/W controlled ring buffers, but we'll see. 
>>
>> Cheers
>>
>> Phil Hobbs  
> 

[toc] | [prev] | [next] | [standalone]


Page 7 of 8 — ← Prev page 1 2 3 4 5 6 [7] 8  Next page →

Back to top | Article view | sci.electronics.design


csiph-web