DCD command - need some advice


Closed Thread
Results 1 to 21 of 21

Hybrid View

  1. #1
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Yup it should fix the problem. THE ADCON1=$0F setting was good for the previous PIC18F2550... wich, i feel, will gather dust for awhile

    I never used POT command, i prefer to use a real A/D converter instead. ADCIN or the eternal write/read PIC register solution. For an audio trigger... i would use a analog comparator instead as they react way faster.
    Last edited by mister_e; - 17th December 2006 at 09:51.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  2. #2
    malc-c's Avatar
    malc-c Guest


    Did you find this post helpful? Yes | No

    Default

    Guys, thanks once again.

    I'll try the changes a little later and see how I get on.

    If I read that table correctly, by entering the value in the left column, AN0, AN1 etc are set accordingly. So for example 0000 would cause all the pins (AN0 - AN7) to be analogue. 011x would do the opposite and make them all digital ?

    I take it the $0f etc is just the Hex value for those dec numbers 0000 - 1111 ?

    was good for the previous PIC18F2550... which, i feel, will gather dust for awhile
    LOL - yeah.. you're probably right !

    For an audio trigger... i would use a analog comparator instead as they react way faster
    Steve, when I'm ready for looking at using music for the sound to light / chaser component I'll be interested to hear your suggestions as i've never used these sort of functions on a PIC before.

    Thanks again

  3. #3
    malc-c's Avatar
    malc-c Guest


    Did you find this post helpful? Yes | No

    Default

    Steve(s)

    That works fine (I had no reason to doubt it wouldn't)

    Slightly off topic, but I would like to run some ideas by you.

    I want to have three sections, chase, music and s2l. Chase is the section I've already written (with your help) that simply runs the selected pattern at what ever speed is set by the pot. Music is where I want to make the 8 LEDs act like a level meter, just like that on most tape decks or top end video recorders. S2L is a sound to light, where the music is split by filters for bass, mid and treble.

    For the music section I was thinking that i could simply connect the line in (1v peak to peak) from the CD player direct to a pin on the PIC and use the A to D convertion - although Steve mentioned someing about a comparator.. would this work ?

    As for the sound to light section (s2l) I was thinking of building something like the filter section shown on this site http://sound.westhost.com/project62a.htm but only using bass, lower midrange, upper midrange and treble, with two LEDs being driven from each filter (ie bass drives RB0 and RB1, lower mid RB2 and RB3, upper mid RB4 and RB5 with treble driving RB6 and RB7) -

    Comments would be wellcome

  4. #4
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    The PIC have only 2 comparator if my memory serves me well, you if you need 3 different trigger source working at the same time you will need to add some external stuff... not really interesting.

    Here the ADC solution have it's own advantages. It will allow as many trigger source as you have ADCs. ALSO you can implement software threshold on EACH audio band (low, mid, high)

    well configured and speed optimized (clock source, acquisition time), ADC are not so slow, and BTW, we don't talk about something really timing critical... it's visual effect on audio. nobody will see the difference in a few ten or hundreds uSec of latency

    So you build a modern version of the old-timer 'color organ' ?
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  5. #5
    malc-c's Avatar
    malc-c Guest


    Did you find this post helpful? Yes | No

    Default

    Thanks for the reply,

    Yes, I've been playing with making a colour organ (or sound to light unit) for some time. I originally made a basic unit using a 16F877 with code written in JAL (sory for swearing on the PBP forum ) - I then discoverd PBP and ported the basics over to a 16F628a, but never got around to doing the music side, and was limited by the number of pins so i couldn'l use the LCD.

    Now I'm determined to build the filters, get a decent bass beat peak circuit made, and include a normal sound to light based. This is really my first advancement from the simple "flash a LED" and combined with the factI've not coded for a while its a steep learning curve

    I'll swat up on the ADC section of the manual. I have used RA2 and RA3 for switches, but as these are AN2 and AN3 I will change them to RA4 and RA5 so that will leave RA0/AN0, RA2/AN2, and RA3/AN3 for use with the audio side.

    No doubt I'll probably need a helping hand to debug the code, but I'll see how far I can get on my own first, hopefully without blowing up the PIC (or the CD player !)

  6. #6
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Yeah... be carefull and good luck.

    See you... soon
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  7. #7
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by malc-c
    Thanks for the reply,

    Yes, I've been playing with making a colour organ (or sound to light unit) for some time. I originally made a basic unit using a 16F877 with code written in JAL (sory for swearing on the PBP forum ) - I then discoverd PBP and ported the basics over to a 16F628a, but never got around to doing the music side, and was limited by the number of pins so i couldn'l use the LCD.

    Now I'm determined to build the filters, get a decent bass beat peak circuit made, and include a normal sound to light based. This is really my first advancement from the simple "flash a LED" and combined with the factI've not coded for a while its a steep learning curve

    I'll swat up on the ADC section of the manual. I have used RA2 and RA3 for switches, but as these are AN2 and AN3 I will change them to RA4 and RA5 so that will leave RA0/AN0, RA2/AN2, and RA3/AN3 for use with the audio side.

    No doubt I'll probably need a helping hand to debug the code, but I'll see how far I can get on my own first, hopefully without blowing up the PIC (or the CD player !)

    I've got a decent FFT running on an 18F4620 that pulls data from 0hz - 20khz at about 15 times per second onto the lcd. Check the video file at

    http://web.ndak.net/~jdgrotte/picalyzer/picalyzer.htm

    It works pretty good except the input filter that I had on it sucked bad. I was trying to cut off everything above 20khz to keep out the artifacts (or is it anti-aliasing? I forget), it never quite worked right, I gave up. But the digital part works great.
    JDG

    EDIT:
    I forgot to mention....TURN DOWN YOUR SPEAKERS! Or at least get the dog out of the room!

Similar Threads

  1. Need "PIC16F84A" Controler schematic Advice...
    By Kyo_89 in forum Schematics
    Replies: 1
    Last Post: - 28th May 2009, 00:03
  2. Design Advice
    By isaac in forum General
    Replies: 38
    Last Post: - 12th October 2008, 00:07
  3. Your OTP advice?
    By truvahorse in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 28th June 2008, 17:37
  4. NCD vs. DCD - Commentary
    By andrewroz in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 6th November 2007, 00:16
  5. Advice needed on 'neat' Project!
    By vacpress in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 11th February 2007, 07:21

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