RF12 module need to convert some C to Basic


Closed Thread
Results 1 to 40 of 44

Hybrid View

  1. #1
    Join Date
    Aug 2003
    Posts
    985


    Did you find this post helpful? Yes | No

    Default Re: RF12 module need to convert some C to Basic

    I’m struggling to find C code in this thread that isn’t directly converted to PBP.

    C:
    Code:
    temp|=DATA;
    PBP:
    Code:
    temp = temp|data'
    C falls short of PBP or asm for bitwise operations because you can never access a bit in a single instruction,
    hence the bit mask is being used in C to only write the set bits in the temp variable.
    Code:
    B800 = 1011100000000000
    DATA = 0000000000001111
    
    B800 | DATA = 1011100000001111
    If you’re clocking the external chip, and then feeding the pic it’s output clock that would normally be a very good idea
    because once you send the command to PLL the external chip's clock higher, both chips are clocked at the higher speed,
    and no timing adjustment of the SPI or SHIFTOUT routines should need adjusting,
    EXCEPT for the fact that the pic’s instruction clock is divided by 4, so the two chip’s practical instruction timing is not increased evenly,
    so you will need two different communication timings for the two different speeds of the external chip.

  2. #2
    Join Date
    Aug 2003
    Posts
    985


    Did you find this post helpful? Yes | No

    Default Re: RF12 module need to convert some C to Basic

    All of the While loops are the same as PBP While...WEND where the closing brace is WEND.

    Code:
       n=16;
       while(n--) {dosomething();}
    Code:
    n=16;
    WHILE (n > 0)
    gosub dosomething’
    n = n - 1'
    WEND

Similar Threads

  1. Version Control
    By btaylor in forum mel PIC BASIC Pro
    Replies: 33
    Last Post: - 16th October 2011, 18:12
  2. Loop with two motor and 2 sensors
    By MrRoboto in forum mel PIC BASIC
    Replies: 4
    Last Post: - 9th December 2008, 00:40
  3. Replies: 1
    Last Post: - 27th July 2008, 07:14
  4. using AND as an IF statement
    By dw_pic in forum mel PIC BASIC
    Replies: 27
    Last Post: - 8th June 2006, 19:05
  5. convert Basic Stamp2 (BS2) => Pic
    By bs2rdu in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 15th September 2005, 20:55

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