Allegro A6280 with PICBASIC


Closed Thread
Results 1 to 26 of 26

Hybrid View

  1. #1
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959

    Default

    END is a reserved word and can't be used as a label.

    The blue loop is GOSUBing back to itself. It should be GOTO.

    And, it needs to turn off the CCP module before shifting any data.

    Make sure the PAUSE 500 is NOT in the latching: subroutine anymore.

    Code:
    BVar = 1023
    
    blue:
        CCP1CON = 0
        shiftout d2pin, c2pin,1 [funct\1,Rvar\10,Gvar\10,Bvar\10]
        gosub latch
        gosub BringUpPWM
        pause 100
        Bvar = Bvar - 2
        if bvar < 3 then goto BlueDone
    GOTO blue
    
    BlueDone:
    DT

  2. #2
    Join Date
    Aug 2007
    Posts
    10

    Default

    Ok, I'll try the code tomorrow morning as it is too late now. Hope it works, thanks and I'll let you know the result by tomorrow. Thanks

  3. #3
    Join Date
    Aug 2007
    Posts
    10

    Thumbs up

    BINGO! Darrel, you're the best! Thank you again for the code, now I can dim the LED. Now, the only think in my concern is that when I control too many clusters, the PIC might not be able to store that much of data isn't it? Do you have any recommendation? Hehehe, sorry if I ask too much but really appreciate your help. God bless. Thanks again.

  4. #4
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959

    Default

    Awesome!

    Not bad for someone that's never seen that chip before. eh

    Well, as far as the memory requirements go. At 6 bytes per cluster (PWM only), you can run an awful lot of clusters with just about any chip. But if it gets to be too many, just throw on a serial FRAM, and you could light up several hundred or thousand clusters, easily.

    Well, assuming you had that may pins on your PIC.
    Since each cluster needs it's own Latch line, it's kind of limiting.
    Of course you could always run the devices in series with a common latch, or add some shift registers to increase the Latch count, but now I'm getting into a whole different area.

    DT

  5. #5
    Join Date
    Aug 2007
    Posts
    10

    Default Help

    Dear Darrel, I still need some help here. Can you kindly give me your email address? I need to send some attachment to you. Thanks & have a great weekend.

    Warmest Regards,
    Kevin Loh

Similar Threads

  1. Picbasic VS C Compiler
    By koossa in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 11th October 2005, 21:44
  2. Replies: 22
    Last Post: - 12th July 2005, 17:39
  3. 1st 16F877A program in PICBasic
    By Borisw37 in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 19th January 2005, 04:46
  4. PicBasic Fundamentals
    By Billyc in forum General
    Replies: 9
    Last Post: - 4th May 2004, 10:04
  5. PicBasic Pro & PicBasic syntax different
    By Billyc in forum General
    Replies: 5
    Last Post: - 16th April 2004, 21:19

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