Search Results - MEL PICBASIC Forum


Search:

Type: Posts; User: photoelectric; Keyword(s):

Page 1 of 2 1 2

Search: Search took 0.00 seconds.

  1. Replies
    33
    Views
    37,535

    Re: PBP for dsPIC 16bit??

    hi,
    any example of application using dsPIC??
    if it is just driving specific motor application would be wasted for dsPIC??

    thanks
  2. Replies
    56
    Views
    32,426

    Re: 3 channel PWM with customize duty cycle

    hi,

    long time no see :D

    after many times checking on my pwm using osiloskope, i found out that the pattern of the pwm isnt fixed according to the lookup table value while the PIC is running....
  3. Replies
    33
    Views
    37,535

    PBP for dsPIC 16bit??

    hi all,

    Is it possible??i mean all the command listed in the PBP green book can be used for dsPIC??

    thanks
  4. Replies
    56
    Views
    32,426

    Re: 3 channel PWM with customize duty cycle

    Hi,

    thank you for the example.
    Then, i add-up CCP1CON = %00000000 in the interrupt handler in order to turn off the pwm for a while. Turns out that after it come back to normal operation, the pwm...
  5. Replies
    56
    Views
    32,426

    Re: 3 channel PWM with customize duty cycle

    Hi,

    OIC. tq
    So, i notice that the led will turn off whenever the faultsignal is change BUT after a few milisec it turns ON back.
    The problem on my design is that i dont know how much time the...
  6. Replies
    56
    Views
    32,426

    Re: 3 channel PWM with customize duty cycle

    hi,
    i try to test my simple interrupt on my real PIC simulation.
    below is my codes:


    led VAR PORTC.4

    TRISB.0 = 1 'set port bo to input
    ON INTERRUPT GoTo myint '...
  7. Replies
    56
    Views
    32,426

    Re: 3 channel PWM with customize duty cycle

    hi,

    OK i will play it using LED first. The port B0 that i declare says that when the fault signal detect 5V is the normal operation, when suddenly changes to 0v, port B0 automatically goes to my...
  8. Replies
    56
    Views
    32,426

    Re: 3 channel PWM with customize duty cycle

    Hi,

    i read the ON INTERRUPT section on PBP book and still trying to understand it.
    if i want to implement an interrupt command on my codes, should i declare the interrupt in the main loop?
    ...
  9. Replies
    56
    Views
    32,426

    Re: 3 channel PWM with customize duty cycle

    Hi,

    tq for explaining.
    Yes, actually i want to try adding 2 types of circuit protection system into my previous codes.

    type 1 is basically come from outside signal called fault signal. when...
  10. Replies
    56
    Views
    32,426

    Re: 3 channel PWM with customize duty cycle

    Hi,

    Tq again,
    can i say if i want set AN9-AN13 to digital , i need to set the register value ADCON1 = 6 ?
    sry for this newbie question, still trying to learn this PIC things etc..
    correct me if...
  11. Replies
    56
    Views
    32,426

    Re: 3 channel PWM with customize duty cycle

    hi,

    im back :)

    tq for your advice. i change the port b to digital by just adding:

    adcon1 = 7

    then it works fine. Actually, i only follow the example in the PBP book and i dint really...
  12. Replies
    56
    Views
    32,426

    Re: 3 channel PWM with customize duty cycle

    Hi,
    its works on simulator for all phases but in real world only phase 3 as i mention before.

    i think its the pin portb.4 and portb.3 on the PIC16F737 but im not sure.

    A) yes, i have check the...
  13. Replies
    56
    Views
    32,426

    Re: 3 channel PWM with customize duty cycle

    Hi,

    ive just test it on real physical PIC and found out that phase 1 and phase 2 works fine but phase 3 wont work very well.
    As you can see from the attached named Phase 1 shows the correct...
  14. Replies
    56
    Views
    32,426

    Re: 3 channel PWM with customize duty cycle

    Hi,

    yes, i set all the pin state 1st but outside the main loop, i simulate it and my switching and my 3 phases channel all works ok.
    i will test it in the real physical PIC tmrw and see the...
  15. Replies
    56
    Views
    32,426

    Re: 3 channel PWM with customize duty cycle

    hi,

    i compile the additional example of yours into my codes and it works ok but at the toggle part dint works well.

    attached is the simulation using the real pic simulation named result:
    as...
  16. Replies
    56
    Views
    32,426

    Re: 3 channel PWM with customize duty cycle

    Hi,

    my explanation is same like coding below:



    defineosc 20
    DUTY1 var word
    DUTY2 var word
    FREK var word
  17. Replies
    56
    Views
    32,426

    Re: 3 channel PWM with customize duty cycle

    Hi,
    Thanks again for the example. This is my 1st time using PIC Basic pro languange and im trying very hard to learn it. hope you can assist me more in the future.

    i test it and it works fine for...
  18. Replies
    56
    Views
    32,426

    Re: 3 channel PWM with customize duty cycle

    Hi,

    Im still trying to understand your explaination.
    So i have to use count command?
    can you give me an example of code for me to refer to?

    photoelectric
  19. Replies
    56
    Views
    32,426

    Re: 3 channel PWM with customize duty cycle

    hi,
    thks for the explanation, now my pwm works fines.
    attached is my currently pwm pattern for ccp1 and ccp2.
    NOw, i want to shift the CH2 pwm about 1/3 of the duration of the CH1 pwm which is
    ...
  20. Replies
    56
    Views
    32,426

    Re: 3 channel PWM with customize duty cycle

    hi, yes you are correct, i test it on real physical and it works fine.
    But i dint really understand on how you calculate the execution of my FOR NEXT loop. Can you explain a liltle bit detailed on...
  21. Replies
    56
    Views
    32,426

    Re: 3 channel PWM with customize duty cycle

    yes, i remove the pause statement because i think adding it causing the pwm duty longer then the original pwm duty, hence changing my pwm pattern.
    can we actually pause below 1 ms since i know pause...
  22. Replies
    56
    Views
    32,426

    Re: 3 channel PWM with customize duty cycle

    hi,
    i stick with prescaler 4 and alrdy key in my dutycycle in my lookup using command lookup2 since it can support til 10bits wide.
    below is my complete coding for 1 channel PWM:

    DEFINE OSC 20...
  23. Replies
    56
    Views
    32,426

    Re: 3 channel PWM with customize duty cycle

    ok i got the idea right now.
    what about value in the lookup table? is it 8 bit wide or more because
    from my calculation of duty cycle:
    let say 50%
    prescaler 4
    PR2+1 =250

    so duty2 = 250*4*0.5...
  24. Replies
    56
    Views
    32,426

    Re: 3 channel PWM with customize duty cycle

    tq again,

    got your point now.
    let say i use prescaler 1 for maximum resolution, my PR2+1 should be 1000.
    So , let say i want to put 50% duty cycle in my lookup, my duty2 value should be:
    ...
  25. Replies
    56
    Views
    32,426

    Re: 3 channel PWM with customize duty cycle

    thank you for the explaning,
    so, can i conclude that it doesnt matter to set prescale 1,4 or 16 since the value of PR2 will be change??

    for instance,
    prescale = 16 ,PWM freq =5kHz for 20M Fosc...
Results 1 to 25 of 32
Page 1 of 2 1 2