Hello,and my first question...


Closed Thread
Results 1 to 3 of 3
  1. #1
    Moldava's Avatar
    Moldava Guest

    Default Hello,and my first question...

    Hello,i'm new here and new to the world of programming,ithough i've already had some success with picbasic,microcode ,pic12f629 asnd 16f628...my question... i want to replace a counter that writes and read a 1m x 8bits ram,so it has to be a 20 bit counter..the clock that drives that counter is between 20khz and 60 khz...i've tried performing that by polling the clock input pin (ra0 in a 16f628,using the internal 4mhz oscillator),incrementing the counter when it changes from 0 to one and using a flag to avoid increasing it twice on the same clock cycle...well,it works ok at low frequencies,but not at 20khz...i also have to control the read and write signals,monitor a run/stop input for storing ram locations...well,maybe is too much for pic basic,or i'm just an ignorasnt newbie(this is probably the case...)
    Thanks for your help and ideas...

    Moldava

  2. #2
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    It's not too much for PICBasic at all (remember, this is NOT an interpretive Basic), but might be too much for a 4MHz PIC all depending what it's got to do besides counting 60kHz pulses. This little ditty will show you how far you can go before things start falling apart... use a Double-Trace Scope, monitoring the Input and Output pins, wind the frequency up until the output starts to fall over... you might be surprised...

    TRISB=%00000001

    InputPin var PortB.0
    OutputPin var PortB.7

    Start:
    Low OutputPin
    Loop:
    While InputPin=0:Wend
    High OutputPin
    While InputPin=1:Wend
    Low OutputPin
    Goto Loop

    End

    Melanie

  3. #3
    Moldava's Avatar
    Moldava Guest


    Did you find this post helpful? Yes | No

    Default

    Thanks,Melanie,i'll try it today...:-)

Similar Threads

  1. ADCIN question
    By Greg McFadden in forum General
    Replies: 4
    Last Post: - 16th September 2008, 02:53
  2. AN Question for "word" variable read The serial port
    By redfoen in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 14th December 2007, 17:39
  3. Remote PIC input question
    By Adrian in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 1st September 2007, 15:44
  4. Question for a math guru
    By Christopher4187 in forum General
    Replies: 3
    Last Post: - 22nd November 2006, 09:45
  5. Please answer my first question
    By John_001 in forum Off Topic
    Replies: 1
    Last Post: - 15th September 2006, 06:49

Members who have read this thread : 1

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