Menu

Can you put two pulseout commands on same line

Help
rowdy
2020-07-22
2020-09-11
  • rowdy

    rowdy - 2020-07-22

    Hello
    I am trying to make a very simple pulse generator with a PIC (12f1840 )
    I am trying to get two 30 microsecond pulse's out at same time,
    one is normal , the other is inverted on two separate pins at same time
    my code for the two pulses, can the command be written on same line
    PulseOut PORTA.1, 30 us : PulseOutInv PORTA.2, 30 us

    will this give pulses out on seperate pins or should I use the set and wait commnds ? thanks

     

    Last edit: rowdy 2020-07-23
  • stan cartwright

    stan cartwright - 2020-07-24

    Seems to work.

     
  • stan cartwright

    stan cartwright - 2020-07-24

    Increase the pulseout and pulseoutinv to longer time and you can see pulseout is like wait ie stop program flow until finished

     
  • stan cartwright

    stan cartwright - 2020-07-24

    Your set port.x on offgives more simultaneous results

     
  • stan cartwright

    stan cartwright - 2020-07-24

    This does not work

    do
    pulseout portd.7,30 us
    portd.6 = not portd.7
    wait 200 us
    loop
    
     
  • rowdy

    rowdy - 2020-07-25

    Thanks I will report back

     
  • rowdy

    rowdy - 2020-09-11

    We have been in stage 4 china virus lock down for weeks, including a night time curfew, its a real pain, anyhow after testing if you put PulseOut PORTA.1, 30 us : PulseOutInv PORTA.2, 30 us, ether in the same line or on line below, the second inverted pusle happens AFTER the first pulse, , but if you use the SET on and off on same line the two pulses happen at same time no delay, thanks Stan

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.