hpwm more than 2 ch possible in pbp?????????


Closed Thread
Results 1 to 21 of 21

Hybrid View

  1. #1
    Join Date
    Feb 2005
    Posts
    130


    Did you find this post helpful? Yes | No

    Default

    Im refloating this thread because I have a question:

    I tried the example provided by Bruce succesfully, but now I want to use ON Interrupt on portb changes.

    The problem I encounter is that CCP3 uses RB5 and the interrupt is triggered by changes in the portb.4 to portb.7

    What can be done?

    Thanks

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


    Did you find this post helpful? Yes | No

    Default

    Help us a litle bit Pic model?

    How bad/good it is if in the INT routine you test the PORTB and if it's just related to the HPWM, it goes out of there ?
    Steve

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

  3. #3
    Join Date
    Feb 2005
    Posts
    130


    Did you find this post helpful? Yes | No

    Default

    Sorry Im using the same pic as Bruce example: 16F767

    but Im having more basic problems, when I wasnt able to run the program as desired I started to remove parts of it, and now I see it does not work at all, so I may be missing some register configuration.

    Here is the header of my program:


    Code:
    @ device pic16F767, wdt_on, intrc_osc_noclkout, mclr_off, protect_off
    
    
    trisb   =%11000000
    trisa   =%00000001
    cmcon   =%00000111  'Comparators Off
    intcon  =%10001000  'interrupts enable    
    
    ; Set CCP modules to PWM mode
    CCP1CON = %00001100 ' Mode select = PWM
    CCP2CON = %00001100 ' Mode select = PWM
    CCP3CON = %00001100 ' Mode select = PWM
    
    PR2 = $20    ; Set period 
    
    pie2.1=0    ;disable interrupts on CCP3 (I think this should work)
    
    ; Set TMR2 up for 1:1 prescale & turn it on
    T2CON = %00000100 ' TMR2 ON 1:1 prescale
    
    porta=0:portb=0:portc=0
    
    pause 100
    
    
    high porta.1
    pause 200
    low porta.1
    pause 200
    high porta.1
    pause 200
    low porta.1
    
    end
    As you can see very basic, and I dont even started with the pwm/interrupts stuff.

    I program the pic via ICSP and power it, it seems to run at turtle speed , the 200ms pause takes 28seconds...


    What I am missing? Thanks

  4. #4
    Join Date
    Oct 2004
    Location
    Hangover, Germany
    Posts
    289


    Did you find this post helpful? Yes | No

    Talking

    Quote Originally Posted by peu
    I program the pic via ICSP and power it, it seems to run at turtle speed , the 200ms pause takes 28seconds...


    What I am missing? Thanks

    What is about a DEFINE OSC ?
    At what speed does the PIC work ?
    What speed did you tell the PBP-Compiler ?

    ;-)
    PBP 2.50C, MCS+ 3.0.0.5, MPLAB 8, MPASM 5.14, ASIX Presto, PoScope, mE mikroBasic V7.2, PICKIT2

  5. #5
    Join Date
    Feb 2005
    Posts
    130


    Did you find this post helpful? Yes | No

    Default

    Oh I didnt post it in my previous post sorry, there is a define osc 4 below the @device statement

    but it still goes slow...


    Pablo

  6. #6
    Join Date
    Feb 2005
    Posts
    130


    Did you find this post helpful? Yes | No

    Default

    any idea? Thanks

  7. #7
    Join Date
    Feb 2005
    Posts
    130


    Did you find this post helpful? Yes | No

    Default

    I could use some help Thanks in Advance

Similar Threads

  1. HPWM of the port of two HPWM
    By ja2rqk in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 25th April 2007, 15:05
  2. Microcontroller with 2 way paging application problem
    By oneohthree in forum mel PIC BASIC Pro
    Replies: 30
    Last Post: - 20th April 2007, 17:27
  3. Replies: 2
    Last Post: - 10th July 2006, 01:05
  4. sound command & music
    By trying in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 26th May 2006, 14:14
  5. 3 HPWM channels
    By docwisdom in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 4th April 2006, 02:43

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