Strange problem with PBP 2.50


Closed Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107

    Default Strange problem with PBP 2.50

    The following code compiles and runs fine under PBP 2.47
    but hangs forever in PBP 2.50


    B0 = $AA
    Addr = 65534
    I2CWRITE SDA1,SCL1,RevABase,addr,[B0]
    Pauseus 20
    I2CWRITE SDA1,SCL1,RevBBase,addr,[B0]
    PAUSEus 20
    I2CWRITE SDA1,SCL1,RevCBase,addr,[B0]
    PAUSEus 20
    I2CREAD SDA1,SCL1,RevABase,addr,[B1]
    PAUSEus 20
    I2CREAD SDA1,SCL1,RevBBase,addr,[B2]
    PAUSEus 20
    I2CREAD SDA1,SCL1,RevCBase,addr,[B3]

    The I2C device is an EEPROM.
    "RevxBase" is a BYTE variable
    "Addr" is a word variable

    Clock is 40Mhz, but I have the define "I2C_SLOW 1"
    2.2K pull-ups are used on SDA and SCL
    PIC is 18F8722

    The program hangs whenever I do a I2CWRITE -or- I2CREAD

    Has anyone else had this problem with 2.50?
    Charles Linquist

  2. #2
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default

    Charles Linquis, I have recompiled a program w/PBP2.50 that uses 2 24LC1025's and have had no problem... This is the code I use:

    '************************************************* ********************
    READ_WRITE_BLK1025: 'WRITE TO or READ FROM SERIAL EEPROM NEXT AVAILABLE STORAGE BLOCK
    '************************************************* ********************
    SCL = 0 'PRESET CLOCK STATE TO LOW
    ADDRESS = 65534 'POINT TO LAST STORED DATA(WORD) ADDRESS
    CNTROL_BYTE = CNTRL_BYTE 'COPY CONTROL BYTE
    CNTROL_BYTE.1 = 1'DEVICE.1 'SET LSB OF HARDWARE ADDRESS
    CNTROL_BYTE.2 = 0'DEVICE.2 'SET MSB OF HARDWARE ADDRESS
    CNTROL_BYTE.3 = 1'DEVICE.0 'SET 64K BLOCK BIT
    IF READ_WRITE = 1 THEN
    INTCON.7 = 0 'DISABLE ALL INTERRUPTS
    I2CWRITE SDA,SCL,CNTROL_BYTE,ADDRESS,[BLOCK.LOWBYTE,BLOCK.HIGHBYTE] 'WRITE DATA POINTER TO 12C
    INTCON.7 = 1 'RE-ENABLE ALL INTERRUPTS
    PAUSE 6 'ALLOW TIME FOR I2C WRITE ~5Ms.
    ELSE
    I2CREAD SDA,SCL,CNTROL_BYTE,ADDRESS,[BLOCK.LOWBYTE,BLOCK.HIGHBYTE] 'READ DATA POINTER FROM 12C
    ENDIF
    RETURN


    Dave Purola,
    N8NTA

  3. #3
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107


    Did you find this post helpful? Yes | No

    Default

    This says it all -

    Hi Charles,

    There seems to be a problem with the I2C_SLOW define. We are
    investigating.


    Regards,
    Charles Leo
    microEngineering Labs, Inc.
    Charles Linquist

Similar Threads

  1. PBP 2.60 & ADCON1 problem
    By bitbangerbob in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 21st October 2009, 12:06
  2. PIC stop responding - Strange Problem!
    By financecatalyst in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 31st August 2009, 14:06
  3. PBP 2.50 UPGRADE problems!!!!
    By earltyso in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 7th March 2008, 15:42
  4. MCS+ with PBP 2.50
    By BrianT in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 21st September 2007, 05:52
  5. Instant interrupt problem (very strange)
    By yusoweird in forum General
    Replies: 2
    Last Post: - 31st October 2006, 16:15

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