PIC speed problems


Results 1 to 40 of 40

Threaded View

  1. #38
    Join Date
    Jun 2007
    Location
    Mansfield, UK
    Posts
    697


    Did you find this post helpful? Yes | No

    Default

    Yep, your way looks like the way DT's code did it. You turn everything on then count up and turn each LED off as the counter reaches the PWM value. In my code i turn them all off then count down and turn them on when the counter reaches the PWM value.

    I think i probably did it that way because my previous PWM circuits controlled AC lights through a triac. The way you and DT did it would still work and probably be better for AC lights but it needs those other components similar to triacs (cant remember the name) and they are more expensive.

    Ive uploaded the file so you can take a look. I know theres lots of bits that seem pointless at the moment. Ive got to addin all the other stuff that i had before.

    BTW, that still gets serial data in the main loop. I may still need to buffer it in an interrupt once i have all that extra code back in but for now it works and it doesnt need to buffer all the data that arrives.

    Edit: I commented out the bit that resets the serial flag. When i was having trouble i thought maybe that changing PIR1.5 was causing another interrupt or something but it turns out that it works without it. Reading RCREG seems to clear it anyway so is that really needed?

    Edit2: Ive uploaded a newer version of the code. I used your buffer idea for sending serial data. Not sure if it works because i dont have the PIC here to test it. All i know is that it compiles properly. I still need to figure out how to set the stored address. That will be a tough one
    Attached Files Attached Files
    Last edited by The Master; - 8th October 2008 at 12:39.

Similar Threads

  1. Serial VB 2005 pic 16f877a problems
    By Snap in forum mel PIC BASIC Pro
    Replies: 28
    Last Post: - 8th July 2013, 00:52
  2. Pic Vrs Atmel speed
    By shawn in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 26th April 2008, 21:50
  3. Replies: 14
    Last Post: - 26th September 2007, 05:41
  4. IC2 pic 18f452 program problems
    By MrSafe in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 20th September 2007, 18:55
  5. Help, problems first time with 18F452 PIC
    By MikeTamu in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 19th August 2005, 20:49

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