1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

BoostC Charlieplexed PWM 32

Discussion in 'Microcontrollers' started by Mike - K8LH, Jun 25, 2008.

  1. Mike - K8LH

    Mike - K8LH Well-Known Member

    Joined:
    Jan 22, 2005
    Messages:
    3,642
    Likes:
    109
    Location:
    Michigan, USA
    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 (text):

    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: Mar 27, 2009

Share This Page