I2cwrite - I2cread


Closed Thread
Results 1 to 9 of 9
  1. #1
    Join Date
    Jun 2006
    Location
    Greece
    Posts
    302

    Default I2cwrite - I2cread

    I have this:
    I2CWRITE SDA,SCL,ADDR1,[HI,LO,$8E,BAND] 'Sending of the data to the module
    in code and work.
    BAND is : BAND VAR BYTE
    If PLL>720 and PLL<2720 then BAND=$60 'Low range = 45 -> 170 MHz.
    If PLL=>2720 and PLL<=7200 then BAND=$50 'Mid range = 170 -> 450 MHz.
    If PLL>7200 and PLL<14240 then BAND=$30 'High range = 450 -> 890 MHz.

    I want to add and the I2CREAD command to know if the PLL is Lock and to display on LCD.
    I2CREAD SDA,SCL,ADDR2,[LOCK]
    How;
    Last edited by savnik; - 4th July 2006 at 16:24.

  2. #2
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    that will be far easier if you tell us wich PLL you're using
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  3. #3
    Join Date
    Jun 2006
    Location
    Greece
    Posts
    302


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mister_e
    that will be far easier if you tell us wich PLL you're using
    PIC16F84A AND TSA5511

  4. #4
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    refering to table 2 of the datasheet
    Code:
    IF LOCK.6=1 then 
        LCDOUT $FE,1,"PLL in-lock"
        endif
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  5. #5
    Join Date
    Jun 2006
    Location
    Greece
    Posts
    302


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mister_e
    refering to table 2 of the datasheet
    Code:
    IF LOCK.6=1 then 
        LCDOUT $FE,1,"PLL in-lock"
        endif
    Thank you , it's work but show continues.
    I want to show on first line of lcd after the frequency
    like this : 100.3 MHZ LOCK
    and if not lock to show
    like this : 100.3 MHZ UNLOCK

  6. #6
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    PBP manual, LCDOUT section

    Code:
    LCDOUT $FE,1,your frequency plah plah,"MHZ "
    IF LOCK.6=1 then
        LCDOUT "Lock  "
        else
            LCDOUT "Unlock"
        endif
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  7. #7
    Join Date
    Jun 2006
    Location
    Greece
    Posts
    302


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mister_e
    PBP manual, LCDOUT section

    Code:
    LCDOUT $FE,1,your frequency plah plah,"MHZ "
    IF LOCK.6=1 then
        LCDOUT "Lock  "
        else
            LCDOUT "Unlock"
        endif
    Thank you
    I write this code and work:
    LCDOUT $FE, 1 'Clear LCD screen
    LCDOUT #F2 'post the other digits
    LCDOUT "." 'post the comma
    LCDOUT #F3 'post the Khz
    LCDOUT " MHz "
    IF LOCK.6=1 then
    LCDOUT "LOCK"
    else
    LCDOUT "UNLOCK"
    endif
    LCDOUT $FE,$C0
    LCDOUT "PLL FM 87.5-108 "
    Return

    But i want the word LOCK or UNLOCK to begin at 13th position
    I try this LCDOUT $FE, $80 +13
    but it's not work

  8. #8
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    odd... it's working here..

    LCDOUT $FE,($80+13),"lock"
    Last edited by mister_e; - 5th July 2006 at 00:44.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  9. #9
    Join Date
    Jun 2006
    Location
    Greece
    Posts
    302


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mister_e
    odd... it's working here..

    LCDOUT $FE,($80+13),"lock"
    Thank you very much.
    All work fine.
    And the last question.
    When the PLL is unlock shows LOCK and no UNLOCK, changes only if I push one button. Rather it wants one command that it would make I check the each situation of PLL little.
    Or when I close the power and open again

Similar Threads

  1. I2CRead & I2CWrite not working as expected
    By Melanie in forum FAQ - Frequently Asked Questions
    Replies: 30
    Last Post: - 27th October 2021, 18:36
  2. Problem with I2Cread and I2CWRITE function
    By Tony85 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 6th June 2006, 20:03
  3. Problem with I2Cread and I2CWRITE function
    By Tony85 in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 6th June 2006, 18:32
  4. PFC8583 Connection and I2Cwrite I2cread!
    By uludere72 in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 27th February 2006, 13:32
  5. I2CWRITE and I2CREAD
    By Tomas in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 23rd April 2004, 02:30

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