Timing diagram for MSGEQ7 spectrum analyzer chip, is it correct?


Closed Thread
Results 1 to 10 of 10

Hybrid View

  1. #1
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,612


    Did you find this post helpful? Yes | No

    Default Re: Timing diagram for MSGEQ7 spectrum analyzer chip, is it correct?

    As usual, have YOU tried it yourself?

    Random comments:
    * Don't use HIGH/LOW, they're wasting time and program space.
    * After STROBE goes LOW (active) there's a 36us (minimum) settling time so I'd wait that amount of time before sampling the output.
    * The ADCIN statement is likely to take longer than the needed 18us so there shouldn't be a need to have that delay in there.
    * What's being done in the display subroutine? Does it take longer than 18us? If so move things around and eliminate the other delay as well
    Code:
    FOR Band = 0 to 6
      STROBE = 0
      PAUSEUS 36   ' Wait specified settling time
      ADCIN 1, Value   ' Take a reading, this will take tens of uS depending on how the ADC is setup.
      STROBE = 1
      GOSUB Display  ' This will also take time so we'll most likely meet the 72us minimum strobe to strobe time - needs verifying.
    NEXT
    Or, sample all bands and then display them
    Code:
    Spectrum VAR BYTE[7]
    Band VAR BYTE
    FOR Band = 0 to 6
      STROBE = 0
      PAUSEUS 36   ' Wait specified settling time
      ADCIN 1, Spectrum[Band]
      STROBE = 1
      PAUSEUS 36   ' Can probably be removed altogether since ADCIN will provide the needed "delay".
    NEXT
    The above has obviously not been tested, it's being provided as food for thought.

    /Henrik.

  2. #2
    Join Date
    Feb 2013
    Posts
    1,124


    Did you find this post helpful? Yes | No

    Default Re: Timing diagram for MSGEQ7 spectrum analyzer chip, is it correct?

    No, I haven't tested yet by myself, because I need to assemble circuit, etc. So instead I decided to check software first.

    This code was just an example how I understand timings, in real code I won't use HIGH and LOW statements.
    Display subroutine will either drive MAX7219 with 8x8 led matrix connected, or will multiplex 5x7 discrete leds.

  3. #3
    Join Date
    Jun 2016
    Location
    Melbourne, Australia
    Posts
    29


    Did you find this post helpful? Yes | No

    Default Re: Timing diagram for MSGEQ7 spectrum analyzer chip, is it correct?

    Quote Originally Posted by HenrikOlsson View Post
    * Don't use HIGH/LOW, they're wasting time and program space.
    /Henrik.
    Excuse my ignorance, but what's the alternative to setting bits without using high/low?
    Is it preferable just to use "PORTB.1 = 1" etc?

    Regards,
    Marty.
    Last edited by OldMarty; - 6th July 2016 at 01:55.

  4. #4
    Join Date
    May 2013
    Location
    australia
    Posts
    2,644


    Did you find this post helpful? Yes | No

    Default Re: Timing diagram for MSGEQ7 spectrum analyzer chip, is it correct?

    Excuse my ignorance, but what's the alternative to setting bits without using high/low?
    Is it preferable just to use "PORTB.1 = 1" etc?
    yes or EVEN BETTER LATB.1 = 1 if chip has LAT regs

    high/low always resets TRIS bit wether it needs to or not (ie already set to output)
    which takes a

    BANKSEL TRISX
    BCF TRISX,PIN
    BANKSEL PORTX
    BSF/BCF PORTX,PIN
    BANKSEL 0

    HEAPS OF STUFF
    Warning I'm not a teacher

  5. #5
    Join Date
    Jun 2016
    Location
    Melbourne, Australia
    Posts
    29


    Did you find this post helpful? Yes | No

    Default Re: Timing diagram for MSGEQ7 spectrum analyzer chip, is it correct?

    Quote Originally Posted by richard View Post
    high/low always resets TRIS bit wether it needs to or not (ie already set to output)
    which takes a

    BANKSEL TRISX
    BCF TRISX,PIN
    BANKSEL PORTX
    BSF/BCF PORTX,PIN
    BANKSEL 0

    HEAPS OF STUFF
    wow, that's a lot of junk going on ;-)
    thanks.

Similar Threads

  1. How to define OSC for vlaues below 1mhz? so you get the timing correct.
    By ofuzzy1 in forum FAQ - Frequently Asked Questions
    Replies: 1
    Last Post: - 3rd May 2011, 16:17
  2. Timing Diagram software suggestions?
    By PickyBiker in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 11th April 2010, 06:11
  3. Circuit Diagram Applications
    By -Dan- in forum General
    Replies: 5
    Last Post: - 11th April 2009, 06:32
  4. Circuit Diagram for interfacing AC to PIC IC?
    By wellyboot in forum Schematics
    Replies: 3
    Last Post: - 8th March 2008, 19:40
  5. Poor mans "semi" logic analyzer
    By anj in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 21st September 2004, 13:26

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts