XOUT and HPWM


Closed Thread
Results 1 to 22 of 22

Thread: XOUT and HPWM

Hybrid View

  1. #1
    Join Date
    Oct 2004
    Posts
    448


    Did you find this post helpful? Yes | No

    Default

    Darrel, that was brilliant!

    Worked the first time. If I wore a hat, i'd have raised it now.

    Thanks and regards,

    Anand

  2. #2
    Join Date
    Oct 2004
    Posts
    448


    Did you find this post helpful? Yes | No

    Default

    Darrel, whatever you suggested in the earlier messages worked perfect, and that's made me more ambitious/adventureous/greedy.

    What I wonder is, can this also be achieved using your popular timer0/1 based PWM techniques (instead of the PIC's HPWM) to modulate the XOUT signal? The idea being able to use this with any pic, and on any pin.

    Thanks in advance.

    Regards,

    Anand

  3. #3
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Hi Anand,

    I think at 120kz, the interrupts required to generate that frequency on ANY pin (250,000 per second) would interfere with the timing of the XOUT command.

    I can't think of an easy way off hand.

    DT

  4. #4
    Join Date
    Oct 2004
    Posts
    448


    Did you find this post helpful? Yes | No

    Default

    Oh, okay.

    Nothing like actually trying it out, I guess.

    Referring to some of your earlier posts I think I should be able to see if it flies.

    Shall keep this thread posted for the benefit of others, if it works.

    Thanks for all the inputs, Darrel.

    Anand

  5. #5
    Join Date
    Dec 2005
    Posts
    1,073


    Did you find this post helpful? Yes | No

    Default

    Anand,

    The 8-pin 12F683 has HWPM and only costs slightly more than the 12F629 or 12F675. I posted a simple example of turning it on/off using ~120kHz with 1ms bursts at 10ms intervals in another thread recently. Here it is again...
    Code:
    DEFINE OSC 8
    @ DEVICE PIC12F683, INTRC_OSC_NOCLKOUT, MCLR_OFF
    
    TRISIO.2 = 0				'GPIO.2=Output
    PR2 = 17			        'PWM Period   117.7kHz
    CCPR1L = 8				'PWM Duty-Cycle  
    T2CON = %00000100    			'Timer2=ON, 1:1 prescale
    OSCCON = %01110001                      'INT HF OSC 8MHz
    WHILE OSCCON.3>0: WEND                  'OSC startup timeout
    WHILE OSCCON.2=0: WEND                  'INT HF OSC stable
    WHILE OSCCON.2>0 
      CCP1CON = %00001100 'PWM ON
      PauseUS 1000        'generate 1ms burst 
      CCP1CON = 0         'PWM OFF
      Low GPIO.2
      Pause 10            'pause 10ms
    WEND
    The disadvantage of using XOUT is that it cannot send microdim/microbright and cannot send the extended commands X-10 introduced 6-7 years ago.

  6. #6
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Hey Anand,

    Still using the 628A ?
    and what OSC ?

    I think I have something for you.

    DT
    Last edited by Darrel Taylor; - 5th May 2006 at 06:49. Reason: Come on... get your butt outta bed, this is Cool!

  7. #7
    Join Date
    Oct 2004
    Posts
    448


    Did you find this post helpful? Yes | No

    Default

    Hi Darrel,

    Yes, still on the 16F628, with the internal 4 Mhz oscillator, although I'm hoping to migrate it to an 8 pin (or even 6?) device.

    I could of course use an 12F683 as Dave pointed out, but I'm still curious to see if this can be done without the HPWM module.

    Very eager to see your suggestion!

    Anand

  8. #8
    Join Date
    Oct 2004
    Posts
    448


    Did you find this post helpful? Yes | No

    Default

    Dave, thanks for the inputs. I could not have designed the actual hardware interface to the mains without your invaluable pointers to powerline carrier articles.

    Are you suggesting that X10 signals would be better generated in PBP without using the XOUT macro? My X10 transmitter is a very basic one, so the micro dim/brights are not an issue.

    I would have loved to have some extended commands though.

    Again, a heartfelt thanks.

    Anand Dhuru

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