Charlie-plexing


Results 1 to 40 of 61

Thread: Charlie-plexing

Threaded View

  1. #11
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,154


    Did you find this post helpful? Yes | No

    Default Re: Charlie-plexing

    Some neat stuff I forgot that I found several years ago on Charlie-plexing.

    Code:
    clear
    define osc4
    cmcon0=7
    ansel=0
    adcon0 = 0
    @ device mclr_off
    @ device wdt_off
    @ device bod_off
    @ device cpd_off
    @ device protect_off
    
    led var byte
    ledstates var byte
    trisstate var byte
    delay var word
    noghost var byte
    gpnoghost var byte
    
    noghost= %111111
    delay= 1500
    
    starthere:
    gpio.3 = 0
    if gpio.3 = 1 then
      goto main
    endif
    goto starthere
    
    main:
    for led = 1 to 6
      select case led
        case 0 : ledstates =%001 : trisstate =%100
        case 1 : ledstates =%010 : trisstate =%100
        case 2 : ledstates =%001 : trisstate =%010
        case 3 : ledstates =%100 : trisstate =%010
        case 4 : ledstates =%100 : trisstate =%010
        case 5 : ledstates =%010 : trisstate =%001
        case 6 : ledstates =%100 : trisstate =%001
      end select
      trisio = noghost
      gpio = ( gpio & %111000) | ledstates
      trisio = (trisio & %111000) | trisstate
      pause delay
    next led
    
    for led = 1 to 5
      select case led
        case 1 : ledstates =%000001: trisstate =%101110
        case 2 : ledstates =%011000: trisstate =%101110
        case 3 : ledstates =%000010: trisstate =%101101
        case 4 : ledstates =%010000: trisstate =%101101
        case 5 : ledstates =%000010: trisstate =%011101
      end select
      trisio = noghost
      gpio = ( gpio & %111000) | ledstates
      trisio = (trisio & %111000) | trisstate
      pause delay
    next led
    
    trisio=noghost
    gpio=gpnoghost
    
    goto starthere
    end
    Name:  Multiplex pins schematic.GIF
Views: 12190
Size:  11.8 KB
    Editted to add some colour, original was black on light gray background.

    I wish I could give a link and credit, but I can't find anything on google for this now (been looking for over an hour).

    Robert
    Last edited by Demon; - 14th December 2014 at 21:42. Reason: Added code instead of PDF

Members who have read this thread : 7

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