Cascading two PICs together


Results 1 to 8 of 8

Threaded View

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


    Did you find this post helpful? Yes | No

    Post

    interesting point. But let's assume 1KHZ a frequency. a cycle should be 1mS right?

    Code:
    HPWM 1,127,1000
    pause 1 ' one cycle
    pause 1 ' two cylce
    pause 1 ' three cycle
    CCP1CON=0 stop PWM
    rought and nasty example. Now you have to implement your tests during those cycles.. mmm
    Code:
    HPWM 1,127,1000  ' Start Motor1
    Hpwm 2,127,1000  ' Start Motor2
    For Msec=0 to 300
        PauseUS 10  ' 10uSec * 300 = 3mSec = 3 Cycles
        If SensorX=Something then Doplahplah
        If sensorY=Somethingelse then DoAnotherPlahPlah
        next
    But there's some other way to use only High/LOW on specific Motor pins then using Pause/Pauseus (or loop of) to do the same thing and do your test within a loop.

    Code:
    For Msec=0 to ((Cycle*100)*2)
        Toggle Motor1
        Toggle Motor2
        PauseUS 5
        If sensor...
        If sensor...
        next
    This will create a 50% duty cycle 'PWM' of a XCycle

    Should be something to play 'round.

    Now, if it was me, i would use HPWM to generate both signal to the motor, then use 2 sensor to monitor the revolution of the wheel using interrupts or internal counter. It add flexibility and also if a motor is burn or else, you'll be able to know it.
    Last edited by mister_e; - 24th May 2006 at 15:10.
    Steve

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

Similar Threads

  1. Communicating between two PICs over DC bus
    By elec_mech in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 7th May 2009, 13:57
  2. Sharing Max232 with two pics?
    By zx81sp in forum Serial
    Replies: 10
    Last Post: - 28th April 2009, 23:22
  3. Retrieving infos from multiple PICs on a bus/chain
    By flotulopex in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 15th October 2007, 05:42
  4. Programming Pins of PICs?
    By Kamikaze47 in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 15th August 2007, 19:59
  5. Dead PICs
    By CocaColaKid in forum mel PIC BASIC Pro
    Replies: 16
    Last Post: - 15th August 2007, 14:12

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