+ Reply to Thread
Page 10 of 10
First ... 6 7 8 9 10
Results 136 to 141 of 141

Thread: BoostC Charlieplexed PWM 32

  1. #136
    Mike, K8LH Excellent Mike, K8LH Excellent Mike, K8LH Excellent Mike, K8LH Excellent Mike, K8LH Excellent Mike, K8LH Excellent Mike, K8LH Excellent
    Join Date
    Jan 2005
    Location
    Michigan, USA
    Posts
    2,522

    Default

    No need to clear the shadow variable when you're shifting 8 new bits into it each interrupt, yes, no?
    Last edited by Mike, K8LH; 25th March 2009 at 04:50 PM.


  2. #137
    Suraj143 Newbie
    Join Date
    Jan 2007
    Location
    South Mald Isld
    Posts
    921

    Default

    Hi Mike I studied your program its very clever.I have a problem.I'm using 4Mhz not 8Mhz.

    I adjusted your program Is this settings ok?

    XT = 4Mhz
    Interrupts = 100uS
    Levels = 100
    Frame Rate = 10000uS = 10mS
    PWM Frequency = 100Mhz

    Whats the advantage using higher PWM frequency Mike? Is 60 PWM frequency do you recommend?

  3. #138
    Mike, K8LH Excellent Mike, K8LH Excellent Mike, K8LH Excellent Mike, K8LH Excellent Mike, K8LH Excellent Mike, K8LH Excellent Mike, K8LH Excellent
    Join Date
    Jan 2005
    Location
    Michigan, USA
    Posts
    2,522

    Default

    Hi Suraj,

    Those settings look fine and a 100 Hz refresh rate should be fine.

    The only advantage for using a higher refresh rate is that you would be able to update the LED array at shorter intervals. You can update the array at 5 msec intervals with the 200 Hz rate or update the array at 10 msec intervals with the 100 Hz rate.

    Did you test your modified program?

    Mike
    Last edited by Mike, K8LH; 26th March 2009 at 03:50 AM.

  4. #139
    Suraj143 Newbie
    Join Date
    Jan 2007
    Location
    South Mald Isld
    Posts
    921

    Default

    Hi Mike, K8LH I've completed the code now I have to make it & see.I'll tell you the progress.

    When I extend the pwm levels like (200 levels) the PWM frequency drops down like 50Hz.Is this good?Will it get unsmoother?
    Last edited by Suraj143; 26th March 2009 at 03:55 AM.

  5. #140
    Suraj143 Newbie
    Join Date
    Jan 2007
    Location
    South Mald Isld
    Posts
    921

    Default

    Hi Mike, K8LH last night I checked on a real hardware your code worked perfectly.You need to uncomment that (xorlw 0ffh) after that it worked.I'm really really happy now.Thanks again for the support.

    Can I use the maximum brightness value 100 instead of 99?

    Now everything is ok reloading the LED variables I'm doing with a lengthy way.I like to use your method using a macro.

    Can I use "Setled 00,00,99,66,20,12,04,01" to load the brightnesses?Or do I have to write a macro to load them?(I never used macros)

  6. #141
    Mike, K8LH Excellent Mike, K8LH Excellent Mike, K8LH Excellent Mike, K8LH Excellent Mike, K8LH Excellent Mike, K8LH Excellent Mike, K8LH Excellent
    Join Date
    Jan 2005
    Location
    Michigan, USA
    Posts
    2,522

    Default

    Hi Suraj,

    Happy to hear your software/hardware is working.

    Yes, you can use pwm values of 100.

    You need to create a macro for that "Setled 00,00,99,66,20,12,04,01" functionality. The macro needs to be placed ahead of the code that uses it within the source file. Many people place it ahead of the code section.

    Code:
    setled  macro   p0,p1,p2,p3,p4,p5,p6,p7
            movlw   p0              ; pwm value 0..99
            movwf   led+0           ; led[0] = p0
            movlw   p1              ; pwm value 0..99
            movwf   led+1           ; led[1] = p1
            movlw   p2              ; pwm value 0..99
            movwf   led+2           ; led[2] = p2
            movlw   p3              ; pwm value 0..99
            movwf   led+3           ; led[3] = p3
            movlw   p4              ; pwm value 0..99
            movwf   led+4           ; led[4] = p4
            movlw   p5              ; pwm value 0..99
            movwf   led+5           ; led[5] = p5
            movlw   p6              ; pwm value 0..99
            movwf   led+6           ; led[6] = p6
            movlw   p7              ; pwm value 0..99
            movwf   led+7           ; led[7] = p7
            endm
    
    Last edited by Mike, K8LH; 27th March 2009 at 10:23 AM.

+ Reply to Thread
Page 10 of 10
First ... 6 7 8 9 10

Similar Threads

  1. BoostC question.. AddressOf
    By Mike, K8LH in forum Micro Controllers
    Replies: 8
    Latest: 24th June 2008, 11:20 PM
  2. LCD degree symbol with sprintf (BoostC)
    By futz in forum Micro Controllers
    Replies: 29
    Latest: 5th June 2008, 04:19 AM
  3. math.h and lib for BoostC?
    By futz in forum Micro Controllers
    Replies: 3
    Latest: 31st March 2008, 05:29 AM
  4. Charlieplexed code segment for the Cricket Thermostat
    By William At MyBlueRoom in forum Micro Controllers
    Replies: 2
    Latest: 14th March 2006, 04:12 PM
  5. My PIC Projects Site NEW (includes 2 Charlieplexed Display)
    By William At MyBlueRoom in forum Electronic Projects Design/Ideas/Reviews
    Replies: 0
    Latest: 28th February 2006, 01:31 PM

Tags for this Thread