Shop OBEX P1 Docs P2 Docs Learn Events
driving one prop chip using another prop — Parallax Forums

driving one prop chip using another prop

mikedivmikediv Posts: 825
edited 2010-04-23 00:09 in Propeller 1
Hi guys I was trying to find details on this .I was trying to put together a multi prop design just 2 props I would use a 5 meg crystal for the main prop but I wanted to drive the second prop clock from the first using the prop chip itself ..

I initially just tried this to see how fast the prop would run with no delays my prop proto board has 5 meg crystal I ran this program

Pub Clock

repeat
dira [noparse][[/noparse] 0 ] : = 1
outa [noparse][[/noparse] 0 ] : = 1
outa [noparse][[/noparse] 0 ] : = 0

actually pullmoll helped me with this , this program works and should toggle the pin as fast as the prop can , I do not have a freq counter but using my prop scope it showed this running at only 2.8K !!! I know this can not be right can it?
Can anyone show me a simple way to calculate how fast my square wave would run using the prop this program and some delays I want 5 meg to drive the second prop chip instead of using crystal is this even possible
thanks guys

Comments

  • localrogerlocalroger Posts: 3,452
    edited 2010-04-20 00:36
    Well you don't need the dira inside the loop. The much faster way to do that in Spin would be:

    dira[noparse][[/noparse]0]~~
    repeat
      !outa[noparse][[/noparse]0]
    
    



    The ~~ thing is just a faster way of saying :=1. The !outa inverts the outa pin in one instruction.

    Now that say, if by 2.8K you mean 2.8 kilohertz then something is wrong. Are you sure you have the directives in the top object to set the clkmode? Because it sounds like you might be running rcfast or even rcslow instead of pll16x.
  • kuronekokuroneko Posts: 3,623
    edited 2010-04-20 02:19
    mikediv said...
    Can anyone show me a simple way to calculate how fast my square wave would run using the prop this program and some delays I want 5 meg to drive the second prop chip instead of using crystal is this even possible
    Assuming your master chip runs at 80MHz the counter setup below gives you a 5MHz clock signal (clkfreq/16). While this does work, people have reported issues with video generation on the slave chip. This may or may not affect you.

    dira |= |< clockPin
    ctra := %0_00100_000 << 23 | clockPin
    frqa := %0001_00000 << 23
    
  • Cluso99Cluso99 Posts: 18,069
    edited 2010-04-20 02:38
    mikediv: I would expect to see your output at around 30KHz (for spin and your instructions) and it will not be symetrical.

    Even in·PASM you could·only get to 10MHz with a 2 instruction loop (xor and jmp) so kuroneko's method is the·best way to go.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Links to other interesting threads:

    · Home of the MultiBladeProps: TriBlade,·RamBlade,·SixBlade, website
    · Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
    · Prop Tools under Development or Completed (Index)
    · Emulators: CPUs Z80 etc; Micros Altair etc;· Terminals·VT100 etc; (Index) ZiCog (Z80) , MoCog (6809)·
    · Prop OS: SphinxOS·, PropDos , PropCmd··· Search the Propeller forums·(uses advanced Google search)
    My cruising website is: ·www.bluemagic.biz·· MultiBlade Props: www.cluso.bluemagic.biz

    Post Edited (Cluso99) : 4/20/2010 2:44:48 AM GMT
  • mikedivmikediv Posts: 825
    edited 2010-04-20 14:04
    Guys thank you all very much ,, localroger you hit the nail right on the head, I did in fact not set the timing I always forget this ... Clusso you are right it clocked right in around 2.5-2.7K with me forgetting to set the clock
    kuroneko thank you for including the code sample
  • AribaAriba Posts: 2,690
    edited 2010-04-20 21:57
    You can also try to connect the XO pin of the first Prop (which has the crystal) to the XI pin of the second Prop.
    So you need no counter and no I/O pin to drive the second Propeller.
    I've done this with a Prop and a PIC, but not tried it with 2 Propellers.

    Andy
  • Cluso99Cluso99 Posts: 18,069
    edited 2010-04-21 01:04
    Andy. This isn't recommended and could prove unreliable.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Links to other interesting threads:

    · Home of the MultiBladeProps: TriBlade,·RamBlade,·SixBlade, website
    · Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
    · Prop Tools under Development or Completed (Index)
    · Emulators: CPUs Z80 etc; Micros Altair etc;· Terminals·VT100 etc; (Index) ZiCog (Z80) , MoCog (6809)·
    · Prop OS: SphinxOS·, PropDos , PropCmd··· Search the Propeller forums·(uses advanced Google search)
    My cruising website is: ·www.bluemagic.biz·· MultiBlade Props: www.cluso.bluemagic.biz
  • JRetSapDoogJRetSapDoog Posts: 954
    edited 2010-04-21 13:53
    @kuroneko/all: why are there sometimes issues with vid. gen. on the second prop clocked this way? Some kind of "jitter" in the clock system (PLL?) of the first prop that scales up the 5MHz frequency of the crystal up to 80MHz?
  • Toby SeckshundToby Seckshund Posts: 2,027
    edited 2010-04-21 19:32
    I cross coupled one Props Xtal "output" to another's Xtal "input" on my attempt of a "Blade2 with PropCMD" board a while back, it doesn't work. When the master prop was reset the Xtal oscillation gets stopped as the prop goes though its bootings, on RCFAST. The slave just crashed ( and wouldn't recover ). This wasn't a problem when they booted together from powerup but they had separate reset buttons

    The jitters are probably phase noise on the first Prop's output, these will be x16'd too

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Style and grace : Nil point

    Post Edited (Toby Seckshund) : 4/21/2010 7:37:23 PM GMT
  • mikedivmikediv Posts: 825
    edited 2010-04-22 01:15
    Ariba could you show me what you mean in a schematic ?? I understand but each prop chip has X0,,XI and the Parallax drawing shows the crystal just going across both pins so if I used X0 to clock the second chip I assume X0 of first prop to XI of second prop but what do I do about the X0 on the second prop just leave it floating? Toby good point but right now this is just a breadboard experiment to see if I can get it to work in the first place.

    kuroneko I hate to be thick but here is what I tried with your code



    CON

    _clkmode = xtal1 + pll16x
    _xinfreq = 5_000_000
    clockpin = 0

    PUB TEST

    dira | = | < clockPin
    ctra : = %0_00100_000 << 23 | clockPin
    frqa : = %0001_00000 << 23

    repeat

    Please assume I have the proper indentation it just looks bad when I post it but the program will compile and run the way it is with no errors it just does not output anything
  • kuronekokuroneko Posts: 3,623
    edited 2010-04-22 01:22
    There is a difference between "| <" and "|<". It needs to be written without the space. Same is true for |= and :=, they are SPIN operators and must be written like that. Also, you can't call a method TEST.

    CON
    
      _clkmode = xtal1 + pll16x
      _xinfreq = 5_000_000
      clockpin = 0
    
    PUB main
    
      dira |= |< clockPin
      ctra := %0_00100_000 << 23 | clockPin
      frqa := %0001_00000 << 23
    
      repeat
    
    DAT
    


    Edit: you can actually get away with "| =" but it just looks wrong [noparse]:)[/noparse] OTOH, ":=" must not contain a space.

    Post Edited (kuroneko) : 4/22/2010 1:34:13 AM GMT
  • AribaAriba Posts: 2,690
    edited 2010-04-22 08:06
    mikediv

    Here is a schematic, but you got it right. Just left XO of the slave Prop open.
    The schematic also shows what I expect how it looks inside the Prop.

    Toby Seckshund made a valid point, either the 2 Props must be reseted / started at the same time, or the
    first Prop must reset the second.
    But this is the same if you drive the second Prop by a pin and a counter from the first Prop. Only 2 crystals
    or an independent Clock source will help if the second Prop must run while the first is stopped.

    Andy
    357 x 267 - 2K
  • mikedivmikediv Posts: 825
    edited 2010-04-22 15:36
    Thanks guys, Toby I actually know this stuff not using test, setting the prop clock ,, my only defense is I am getting old and I keep making the same stupid mistakes ,, I guess its more helpful than people can imagine being able to bounce your thoughts off other people thanks guys. Ariba, Toby is my hero the guy has amazing talent ,, I understand it would probably not be practical to wire it up that way but I am only looking to prove it will work to some degree on a bread board so I Can at least test it, after all this time I still have not done any parallel prop work mostly because my programing skills or lack of them are so limited ,,, Has anyone written any code at all the would demonstrate how multi props could work in parallel ?
  • Cluso99Cluso99 Posts: 18,069
    edited 2010-04-23 00:09
    mikediv: It depends on what you mean by multiple props working in parallel. I used one prop on the TriBlade to drun ZiCog and the other to do a terminal function to VGA and Keyboard. This is two props working in parallel but doing totally different functions.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Links to other interesting threads:

    · Home of the MultiBladeProps: TriBlade,·RamBlade,·SixBlade, website
    · Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
    · Prop Tools under Development or Completed (Index)
    · Emulators: CPUs Z80 etc; Micros Altair etc;· Terminals·VT100 etc; (Index) ZiCog (Z80) , MoCog (6809)·
    · Prop OS: SphinxOS·, PropDos , PropCmd··· Search the Propeller forums·(uses advanced Google search)
    My cruising website is: ·www.bluemagic.biz·· MultiBlade Props: www.cluso.bluemagic.biz
Sign In or Register to comment.