Shop OBEX P1 Docs P2 Docs Learn Events
PWMPAL pulse accumulator — Parallax Forums

PWMPAL pulse accumulator

ArchiverArchiver Posts: 46,084
edited 2003-10-21 15:56 in General Discussion
Hi All!

I've got a simple circuit - A BS2, and a PWMPAL. I'm feeding a logic
level signal into the PWMPAL, pulsing around once a second, and on for
40% and off for 60% (for all the brains out there...)

I simply want to read into my BS2 as to how many pulses have been
counted since I reset the counter!

At the moment, it's kind of working, in that it's counting the pulses,
but sometimes increments by 2, and even by 3, for only 1 pulse...

If anyone has done anything like this, code you please help out!

Thanks a million for atleast reading my post [noparse];)[/noparse]

Mick
Deakin Uni
Down Under

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2003-10-21 15:56
    G'day, Mick, how ya goin'? Are you sure your signal is clean, mate? We
    tested the PWMPAL very thoroughly and feel like with a clean signal it
    counts properly. I hope you don't have a duff PWMPAL ... it's a long
    way between Oz and Rocklin.

    I always have an NX-1000 running on my desk and it has a signal
    generator on it, so I modified one of the PWMPAL demo programs for a
    quick test -- worked perfectly. Give this a try and see what happens.


    Setup:
    SEROUT PpPin, PpBaud, [noparse][[/noparse]"!PWMSS", %00000000]
    SEROUT PpPin, PpBaud, [noparse][[/noparse]"!PWMSP", %00000001]

    Main:
    DO
    SEROUT PpPin, PpBaud, [noparse][[/noparse]"!PWMX0"]
    PAUSE 1000
    SEROUT PpPin, PpBaud, [noparse][[/noparse]"!PWMC1"]
    SERIN PpPin, PpBaud, [noparse][[/noparse]cntr1.BYTE0, cntr1.BYTE1]
    DEBUG CLS, DEC cntr1
    LOOP


    -- Jon Williams
    -- Applications Engineer, Parallax
    -- Dallas Office


    Original Message
    From: mickwah81 [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=ZZ4n4RS199r2bxyGd3Ws8RutEd048ZsCoEYJIaY-hmAi2VtCaR47epJsrE9JbPweHDQ434xZrSt6-nRn]mickwah81@y...[/url
    Sent: Tuesday, October 21, 2003 3:07 AM
    To: basicstamps@yahoogroups.com
    Subject: [noparse][[/noparse]basicstamps] PWMPAL pulse accumulator


    Hi All!

    I've got a simple circuit - A BS2, and a PWMPAL. I'm feeding a logic
    level signal into the PWMPAL, pulsing around once a second, and on for
    40% and off for 60% (for all the brains out there...)

    I simply want to read into my BS2 as to how many pulses have been
    counted since I reset the counter!

    At the moment, it's kind of working, in that it's counting the pulses,
    but sometimes increments by 2, and even by 3, for only 1 pulse...

    If anyone has done anything like this, code you please help out!

    Thanks a million for atleast reading my post [noparse];)[/noparse]

    Mick
    Deakin Uni
    Down Under



    To UNSUBSCRIBE, just send mail to:
    basicstamps-unsubscribe@yahoogroups.com
    from the same email address that you subscribed. Text in the Subject
    and Body of the message will be ignored.


    Your use of Yahoo! Groups is subject to
    http://docs.yahoo.com/info/terms/




    This message has been scanned by WebShield. Please report SPAM to
    abuse@p....
Sign In or Register to comment.