DT Multiple Software PWM and 18F2321 issue


Closed Thread
Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2005
    Posts
    20

    Default DT Multiple Software PWM and 18F2321 issue

    Hello, I'm trying to let SPWM_INT.bas work with a pic18F2321. Before ask here I tested it on a 18F1320 and it work perfectly. OSC HS 20MHz
    take this as example:
    Code:
    for i=0 to 250
      LED=i 'dimm led by use pwm
      PAUSE 10
    high portb.0 'switch on a led
    for i=250 to 0 step -1
      LED=i 
      PAUSE 10
    next i
    low portb.0
    The problem I encountered is that with 18F2321 LED on portb.0 don't switch on/off while pwm dimming works fine. To be more precise it switch on for very few ms then switch off. Another strange thing is that it seems I can't set SPWM_FREQ > 100 because I receive all these errors:
    error Current SPWM configuration is INVALID - NO time left between interrupts
    messg 1 - Try using a "SPWM_FREQ" lower than SPWM_FREQ Hz
    messg 2 - OR, Try using a "SPWM_RES" lower than SPWM_RES
    messg 3 - OR, Use a faster "OSC" than OSC Mhz
    messg 4 - OR, Use fewer SPWM channels
    Probably there are some changes to do, maybe in DT_INTS-18.bas.
    can someone help me?
    Regards

  2. #2
    Join Date
    Aug 2005
    Posts
    20


    Did you find this post helpful? Yes | No

    Default Re: DT Multiple Software PWM and 18F2321 issue

    Solved!
    I just rececked it and I missed to add ADCON1=$0F
    thx

Similar Threads

  1. Darrel's Multiple Software PWM
    By passion1 in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 15th October 2013, 15:21
  2. Sinusoidal PWM generation Using PIC 18f4431
    By oswalam in forum mel PIC BASIC
    Replies: 3
    Last Post: - 23rd February 2013, 15:49
  3. Using Walter's Servo PWM encode / decode code
    By NickMu in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 1st November 2012, 23:17
  4. Weird PWM Behaviour on 16F1825
    By RossWaddell in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 26th October 2012, 21:59
  5. Code Issue - select case or 'if' issue - not sure why
    By jamie_s in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 7th October 2007, 08:52

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