Cordic trig assembly code for PIC18f


Results 1 to 40 of 55

Threaded View

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


    Did you find this post helpful? Yes | No

    Default

    Hi Walter,
    I thought we had this working already.

    Here's one thing I see...
    Code:
      ; Set up the main loop
    sc_loop_start:
      clrf i
      banksel atans
      lfsr FSR0, atans
    banksel will put it in the proper bank for a variable in RAM.
    But he's trying to use it with with a Label in FLASH.

    I'm sure it was just a mistake on his part because the lfsr is correct.
    And with his ASM code at the very beginning, it probably would have come up with bank 0 without him even knowing it.

    However, now that it's in an include file for PBP, that atans table will be at a much higher address in Flash and you'll end up in a different bank than where the variables are.

    Just comment it out.

    I was only 1/3 of the way thru when I found that.
    If it doesn't help, let me know, I'll keep looking for more.

    P.S. You should specify BANK0 for all the variables used with this routine.
    <br>
    Last edited by Darrel Taylor; - 9th February 2009 at 05:50. Reason: BANK0 VARS
    DT

Similar Threads

  1. How much code space do PBP statements use.
    By Darrel Taylor in forum Code Examples
    Replies: 5
    Last Post: - 13th February 2009, 21:31
  2. Loop with two motor and 2 sensors
    By MrRoboto in forum mel PIC BASIC
    Replies: 4
    Last Post: - 8th December 2008, 23:40
  3. Making Program Code Space your playground...
    By Melanie in forum Code Examples
    Replies: 15
    Last Post: - 19th July 2008, 08:26
  4. 4 Chanel Dmx512 ready assembly code to PBP ?
    By syscoder in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 21st March 2007, 23:55
  5. Your Suggestions: Assembly code material?
    By dw_picbasic in forum General
    Replies: 1
    Last Post: - 2nd February 2007, 17:33

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