Shop OBEX P1 Docs P2 Docs Learn Events
Pulse output / input... — Parallax Forums

Pulse output / input...

FORDFORD Posts: 221
edited 2006-04-10 02:08 in Propeller 1
Is it possible to have one cog sending out a pulse stream, say on pin 5, and have another cog reading pin 5 to count the pulses ? (knowing that the external circuitry would have to be compatable with this).

My reason for wanting this is as a self test mechanism for pulse input counting.

Any advice, sample code would be appreciated.

Thanks,
Chris
West Oz.

Comments

  • Paul BakerPaul Baker Posts: 6,351
    edited 2006-04-08 03:12
    Yes it is possible.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    1+1=10
  • FORDFORD Posts: 221
    edited 2006-04-08 03:14
    Thanks Paul, hopefully someone can give me some code tips.

    You must have answered that within 10 seconds of me posting it, appreciated.

    Cheers,
    Chris
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2006-04-08 03:42
    You could also use the cog's CTR hardware to twiddle a pin (set and forget) without resorting launching another cog.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • FORDFORD Posts: 221
    edited 2006-04-08 03:56
    Jon,

    I'll get·a prop up and running (maybe today even), then I may ask you a bit more about the reply you just gave, thanks for that.
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2006-04-08 04:01
    Ron gave you his demo, did he?....· I'm working to learn the CTR myself.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • FORDFORD Posts: 221
    edited 2006-04-08 04:20
    Ron has his demo board, but Ken gave·2 chips·to me via Ron, I'm on the other side of Australia from Ron but would love to spend a day with him on this stuff, which we are sort of arranging. We have some projects we want to build together. His hardware and sensor knowledge is very good, he is a very good·distributor choice for Parallax.

    Today I am starting the journey... "blinkled.spin"... I hope in a few hours.

    I will be keeping these 2 chips and my first breadboard for keepsakes, who knows where all this is going. The prop is perfect for·our appication·with multiple pulse counting and simultaneous display ability.

    Its kind of nice to be in on the ground floor·alongside all the people in this forum, I just wish I had something to offer to the forum, maybe in a year or two I'll get my chance to help a newbie in some way.

    Cheers, Chris
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2006-04-08 05:22
    I liberated a bit of Chip's code and have created a tiny demo that uses ctra to generate pulses and ctrb to count them.· I can't explain the value that goes into the frqa register -- I lifted this from Chip's code.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • FORDFORD Posts: 221
    edited 2006-04-08 05:27
    Many many thanks Jon,

    I'm just trying to get the serial programming tool going at present, having a few issues, just double checking everything. Isnt there a thread somewhere here on the serial tool ?, I'm starting to look now...
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2006-04-08 05:34
    It's in a private forum.· Here's Beau's latest schematic:

    http://forums.parallax.com/attachment.php?attachmentid=40594

    Note that the labels correspond to the PC side of things, so RX on the schematic connects to the TX pin (A30)·of the Propeller.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • FORDFORD Posts: 221
    edited 2006-04-08 05:46
    Cheers, will have a look...
  • FORDFORD Posts: 221
    edited 2006-04-08 05:49
    Jon, the link just tells me...

    You have requested something that does not exist, or you do not have permission to access.

    Would love to see his latest schematic.

    Cheers, Chris
  • FORDFORD Posts: 221
    edited 2006-04-08 07:17
    Due the confidental (embarrassing) nature of my wiring errors, I will just quietly say that all is going, many thanks, and sorry for wasting your time.
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2006-04-08 13:38
    So your programming connection is working now?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • Beau SchwabeBeau Schwabe Posts: 6,545
    edited 2006-04-08 18:15
    Here is the revised COM2Propeller schematic Jon was trying to provide a link to.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
    847 x 537 - 90K
  • FORDFORD Posts: 221
    edited 2006-04-08 22:59
    Jon / Beau,

    Thanks for that.

    I got it going yesterday, but it seems intermittently unstable, I am going to try the new diagram you just gave me,·but I also think I may have an old breadboard problem, I have a brand new one and I'll try that.

    Will let you know how it goes in a few days.

    Right now - taking my old muscle car for its annual·car club license·inspection, you gotta have a variety of toys...

    Cheers, Chris.
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2006-04-09 00:57
    Chris -- please solder everything together on a bit of perboard; a breadboard is really an iffy place for the circuit.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • FORDFORD Posts: 221
    edited 2006-04-09 11:16
    Jon,
    Will use some veroboard and knock something up.
    I guess the lower voltage 3.3v stuf is more sensitive as well to poor contacts / lengthy wires etc.

    Will let you know how it goes.

    Cheers,
    Chris
  • Paul BakerPaul Baker Posts: 6,351
    edited 2006-04-09 16:42
    Chris, you are correct 3.3V logic has smaller noise margins than 5V logic.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    1+1=10
  • FORDFORD Posts: 221
    edited 2006-04-09 22:06
    Paul,
    I was also just thinking about breadboards and micro's, the long metal plates they use would be terrible for a micro, maybe OK for surrounding circuitry, but an oversize breadboard is probably the worst thing I could do.

    All of you guys feedback is appreciated.

    Cheers,
    Chris
  • FORDFORD Posts: 221
    edited 2006-04-10 02:08
    Set it up on veroboard, instant success,

    thanks guys.
Sign In or Register to comment.