Generating 3-phase sine wave..


Closed Thread
Results 1 to 39 of 39

Hybrid View

  1. #1
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by sirvo View Post
    I've done that. It shows 4330Hz...

    Yes, I am sure about it.. It is a 20Mhz Xtal.. Then ~900Hz is the frequency that the block (if flag = 1 ..) is running, but no the timer1 interrupt...

    Thanks !
    That's why I said you're program probably needs to be reworked.
    It's spending too much time inside the 'flag if/then' updating the values, therefore it appears to not be interrupting fast enough, when it's actually trying to get everything done that you want it to do. There's just not enough instruction cycles left between interrupts to get that update accomplished.

    (let's see if anybody gets this reference)
    I guess you could call it a 1201 or a 1202 Program Alarm.

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


    Did you find this post helpful? Yes | No

    Default

    I don't know Sylvio,
    I'm running it here and I don't see the same problem.

    But then, I've got a 16F887. Apples and Oranges...

    Timer1 runs at 4khz, and the IF block executes once after each FLAG, so it runs at 4khz too.

    The whole "block" including the LOOKUP and SAIDA: takes about 70us, so it's not taking too long.

    Unless there's something in the part of the program that wasn't posted. I'm stumped.
    <br>
    DT

  3. #3
    Join Date
    Jan 2007
    Location
    Brazil
    Posts
    108


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by skimask View Post

    I guess you could call it a 1201 or a 1202 Program Alarm.
    Gosh.. hope it isn't be happening...


    Darrel, did you notice that Timer2 is also running to generate the PWM frequency?

    I will remake the wires and test if the crystal is really being used (not as internal osc..)

    Thanks a lot!
    Sylvio,

  4. #4
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Maybe a difference or two (bug fix?) in an older version vs. newer version of the 'Instant Interrupts' related to the timers?

  5. #5
    Join Date
    Jan 2007
    Location
    Brazil
    Posts
    108


    Did you find this post helpful? Yes | No

    Default

    I've been using this one:
    Code:
    '****************************************************************
    '*  Name    : DT_INTS-14.bas                                    *
    '*  Author  : Darrel Taylor                                     *
    '*  Version : 0.93 BETA                                         *
    '*  Date    : JAN 29, 2006                                      *
    '****************************************************************
    '* Rev 0.93  Fixed CMIF and EEIF problem with older PIC's       *
    '*           that have the Flags in PIR1 instead of PIR2        *
    '* Rev 0.92  solves a "Missed Interrupt" and                    *
    '*           banking switching problem                          *
    Is there an update?
    Sylvio,

  6. #6
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by sirvo View Post
    '* Version : 0.93 BETA *
    Is there an update?
    I thought it was farther along than .93b...but after a quick bit of looking, maybe not. Then again, maybe there are a few fixes here and there that just never had the 'official' update done.

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


    Did you find this post helpful? Yes | No

    Default

    .93 is the current version for the 14-bit pics.

    Do you have a CLEAR statement at the TOP of your program?
    <br>
    DT

  8. #8
    Join Date
    Jan 2007
    Location
    Brazil
    Posts
    108


    Did you find this post helpful? Yes | No

    Default

    Last project I used the CLEAR statement, but not in this one.. Would it be necessary since I've set all the variables at the top of the program?
    Sylvio,

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by sirvo View Post
    Last project I used the CLEAR statement, but not in this one.. Would it be necessary since I've set all the variables at the top of the program?
    Maybe ... I'm not really sure.
    The last problem with DT_INTS-18 was because of that.

    DT_INTS-14 is at .93 now because I've never really been confident enough to call it "DONE". And I don't give it as much attention as the 18F version. My Avatar could be a clue.

    Give it a try, couldn't hurt.
    <br>
    DT

Similar Threads

  1. To Generate Sine Wave Using PCPWM of PIC18F4331 (Issue)
    By Cyborg in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 22nd March 2014, 13:39
  2. Sine wave
    By Darrenmac in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 18th May 2009, 03:31
  3. 3 phase supply detector challenge
    By BobEdge in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 15th May 2009, 07:54
  4. 3 phase PWM with dsPIC30F2020
    By nemmard in forum mel PIC BASIC
    Replies: 1
    Last Post: - 21st January 2009, 14:19
  5. 3 phase sequencing
    By ardhuru in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 26th May 2007, 07: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