Pic 12F683 Pulsout Command


+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2011
    Posts
    2

    Default Pic 12F683 Pulsout Command

    Hi, I'm posting in this area because it my first and want to not disturb any other areas of the forum. But I do have a question. I'm building a 'p' wave generator to send a short ultrasonic pulse though a sediment core. The circuit works using high and low commands for the various ports to trigger the digital scope and ultrasonic generator. And I'm fine with that. But I have had no luck using the pulsout command. I'm trying to send out a positive pulse of 50 microseconds to trigger the DSO and turn on the 40,000Hz ultrasonic generator. But it always sends out a ground state pulse. Here is a test code:

    'Test code for pulse Generator Using 12F683 and LED's

    ANSEL = 0 'Analog select set to digital
    CMCON0 = 7 'Comparitor Off
    ADCON0 = 0 'A/D turned OFF
    mainloop:

    high gpio.1 'Set state
    high gpio.0 'Set state
    pulsout gpio.0, 1000 ' Send 1000us HIGH pulse to pin 0
    pulsout gpio.1,1000 'Send 1000us HIGH pulse to pin 1
    pause 1000 'Wait one second

    Goto mainloop 'Forever

    It's very simple what I need to do, but it sends out low 1000us pulses on both GPIO.0 and GPIO.1

    Any ideas? I'm just trying to figure out why it doen't work.
    Thanks

  2. #2
    Join Date
    Aug 2008
    Location
    Portugal
    Posts
    240

    Default Re: Pic 12F683 Pulsout Command

    what is your OSC value?
    Thanks and Regards;
    Gadelhas

  3. #3
    Join Date
    Jul 2003
    Posts
    2,405

    Default Re: Pic 12F683 Pulsout Command

    PULSOUT toggles the pin twice to create the pulse, so set both pins to ground before PULSOUT for a high-going pulse.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  4. #4
    Join Date
    Feb 2011
    Posts
    2

    Default Re: Pic 12F683 Pulsout Command

    Thanks for all the help. I'm using the internal oscillator at 4 Mhz. I set both pins to low and it works perfectly! Thanks Bruce!
    Tom

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