PICBasic newbie problem


Closed Thread
Results 1 to 33 of 33

Hybrid View

  1. #1
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by krohtech View Post
    I use Darrel’s Multi SPWM code to get 8 ch of PWM at 100 Hz. Works GREAT (((thanks Darrel)))
    See:
    http://www.pbpgroup.com/modules/wfse...p?articleid=12
    Forgot about that one.
    I've done it myself on an 18F8722 to the tune of 48 channels of LEDs at 40Mhz, refreshing at 7152.2Hz. Same principle, but relatively easily done. If you can do 2 channels, you can do 100.

  2. #2
    Join Date
    Sep 2007
    Posts
    50


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by skimask View Post
    Forgot about that one.
    I've done it myself on an 18F8722 to the tune of 48 channels of LEDs at 40Mhz, refreshing at 7152.2Hz. Same principle, but relatively easily done. If you can do 2 channels, you can do 100.
    Hey skimask,

    How did you do 48 CHannels. Did you have to modify Darrel's asm code?
    Best Regards,

    Kurt A. Kroh
    KrohTech

    “Goodbye and thanks for all the fish”

  3. #3
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by krohtech View Post
    Hey skimask,

    How did you do 48 CHannels. Did you have to modify Darrel's asm code?
    Didn't use DT's code for that one.
    Just a simple Tmr0 overflow running as fast as it can... When the interrupt hits, I update the channels/pins according to their duty cycle 'register' variable. Outside the interrupt sub, in the main loop, I update the duty cycle 'register' itself depending on whatever I'm doing. Theoretically, assuming there's enough clock cycles in the day, you can run as many channels as you want.
    On the '8722, you could have up to 70 channels of halfway decent PWM (well, 69, one of those pins is input only if I remember right). I only stopped at 48 'cause that's all the red LEDs I had on hand at the time.

  4. #4
    Join Date
    Sep 2007
    Posts
    50


    Did you find this post helpful? Yes | No

    Default

    Can each channel have different duty cycles?

    This is quite a bit over my head, could you post a code example?
    Best Regards,

    Kurt A. Kroh
    KrohTech

    “Goodbye and thanks for all the fish”

  5. #5
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by krohtech View Post
    Can each channel have different duty cycles?
    As many as can be had. Only limitation is processor cycles. Depending on what freq the PWM gets run at, you end up running out of enough cycles to adjust all of the channel's PWM's in the main loop and might run out of cycles in the interrupt loop to update all of the channels before the next interrupt hits.

  6. #6
    Join Date
    Feb 2008
    Posts
    8


    Did you find this post helpful? Yes | No

    Default

    I need at least 16-24 channels, i will investigate more on the forum, if anyone have spotted something useful please be nice to post it here

    Just a simple Tmr0 overflow running as fast as it can... When the interrupt hits, I update the channels/pins according to their duty cycle 'register' variable. Outside the interrupt sub, in the main loop, I update the duty cycle 'register' itself depending on whatever I'm doing.
    That's exactly what I've done in C but that wasn't refresh at the same speed at yours... i was running the outputs @ 220.4 hz but the effects that i need to do with the leds wasn't good , kinda jerky sometimes even with 48mhz (12mips) clock, I ran out off juice :S !

    Btw,skimask why not post it to the code examples or a little example here? I respect your work, if you don't want to share your code it's ok i understand that ...

    Have a nice day you guys!

    You really helped me

    I really love this forum, every time i come, i learn something :P

    Best Regards,
    Laurent
    Last edited by ELCouz; - 9th February 2008 at 10:27.

  7. #7
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by ELCouz View Post
    Btw,skimask why not post it to the code examples or a little example here? I respect your work, if you don't want to share your code it's ok i understand that ...
    Exactly which piece of work do you respect the most?
    Most people don't respect my work at all, if only because it's basically unreadable, as I'm sure it would be to you. The style of coding I've chosen and use is almost unreadable to the person that's not used to it. Ask anybody that's been around awhile, they'll tell you the same thing. The High Colonic Master...yep...that's me...

  8. #8
    Join Date
    Sep 2007
    Posts
    50


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by ELCouz View Post
    I need at least 16-24 channels, i will investigate more on the forum, if anyone have spotted something useful please be nice to post it here
    Hi Laurent

    I have had great sucess with Darrel's DT_INTS-18 and SPWM_INT . I am doing 16 ch of PWM on a pic 18F2410 32 MHz. The pwm is running at 100Hz 8 bit resolution.

    Thanks Darrel (I never tire of saying that)

    take a look at this thread:
    http://www.picbasic.co.uk/forum/showthread.php?t=8088
    Best Regards,

    Kurt A. Kroh
    KrohTech

    “Goodbye and thanks for all the fish”

Similar Threads

  1. Newbie? Problem with LCD
    By lew247 in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 7th December 2009, 19:48
  2. Picbasic Newbie Problem
    By Stargazer3141 in forum mel PIC BASIC
    Replies: 4
    Last Post: - 21st August 2007, 17:40
  3. Problem on writing EEPROM in Winpic800 with picbasic pro
    By selimkara in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 4th May 2007, 16:33
  4. PicBasic Pro Math Problem??
    By Glen65 in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 5th March 2006, 04:36
  5. DMX & PicBasic coding problem
    By magicmarty in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 20th September 2004, 15:35

Members who have read this thread : 1

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