PIC16F88, Bootloader & I2C Memory


Closed Thread
Results 1 to 5 of 5
  1. #1
    digilord's Avatar
    digilord Guest

    Question PIC16F88, Bootloader & I2C Memory

    Hello all,

    I have a PIC16F88 setup with the bootloader from www.sparkfun.com (Screamer/bloader). I have been using it with no problems at all until I needed to use a serial EEPROM with one of my new projects. I used Microchip App Note AN976 for the circuit diagram and substituted my 'F88 for the 'F877A. I connected the SDA and SCL lines on the 'F88 to the correct pins on the 24LC256.

    Here is my code:

    -----------CODE-----------
    DEFINE LOADER_USED 1
    DEFINE OSC 8

    ' Set Baud Rate
    DEFINE HSER_BAUD 9600

    ' Clear UART overflow error
    DEFINE HSER_CLROERR 1

    ' Enable transmit and receive
    DEFINE HSER_RCSTA 90h
    DEFINE HSER_TXSTA 20h

    ' I2CREAD and I2WRITE Commands
    '
    ' Write to the first 16 locations of an external serial EEPROM
    ' Read first 16 locations back and send to serial out repeatedly
    ' Note: for EEPROMS with byte-sized address

    'INCLUDE "modedefs.bas" ' Include serial modes

    DPIN VAR PORTB.1 ' I2C data pin
    CPIN VAR PORTB.4 ' I2C clock pin
    B0 VAR BYTE
    B1 VAR BYTE
    B2 VAR BYTE

    For B0 = 0 TO 15 ' Loop 16 times
    I2CWrite DPIN,CPIN,$A0,B0,[B0] ' Write each location's address to itself
    Pause 10 ' Delay 10ms after each write
    Next B0

    loop:
    For B0 = 0 TO 15 STEP 2 ' Loop 8 times
    I2CRead DPIN,CPIN,$A0,B0,[B1,B2] ' Read 2 locations in a row
    HSerout [#B1," ",#B2," "] ' Print 2 locations
    Next B0

    HSerout [10,13] ' Print linefeed

    GoTo loop
    -----------CODE-----------

    When I have the I2C(Read/Write) lines in my bootloader complains that the proper jump is not in the code. When I comment them out the program loads fine. Either way it compiles just fine. No errors.

    This is my first attempt at using any of the 24LC256 EEPROMS. I have checked the PIC and it is okay. I have my trusty Blinky program I load up on new devices to check them.

    Has anyone seen this before? Have I discovered a bug?

    Thanks in advance!

    Xavier

  2. #2
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    LCDOUT & I2C(Read/Write) will cause problems with this loader. See this thread for the fix.

    http://www.picbasic.co.uk/forum/show...light=screamer
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  3. #3
    digilord's Avatar
    digilord Guest


    Did you find this post helpful? Yes | No

    Question Other Loaders

    I just ordered the MicroCode Studio Pro package with their bootloader. Do you know if it has the same issues?

    I am behind on this project now. I really don't want to change the lib files on every dev station here.

    Thanks!

    Xavier

  4. #4
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    MicroCode loader does not have the same issue.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

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


    Did you find this post helpful? Yes | No

    Default

    I'll second Bruce on that, Mecanique MicroCode Bootloader is the way to go. Since i use this one, no big problem. Worth every $$$ you invest in.

    Thanks Mecanique (David Barker) for that high quality product.
    Steve

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

Similar Threads

  1. I2C Master/Slave 16F88/16F767 working code
    By DanPBP in forum Code Examples
    Replies: 2
    Last Post: - 23rd October 2012, 22:31
  2. HARDWARE I2C SAMPLE CODE question
    By Michael Wakileh in forum Code Examples
    Replies: 2
    Last Post: - 16th June 2009, 21:07
  3. Another I2C Slave Routine Problem
    By DanPBP in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 19th February 2009, 05:50
  4. I2C Master Slave issues.
    By cpayne in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 29th March 2008, 19:33
  5. Please help with i2cslave i2c slave
    By cycle_girl in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 1st December 2005, 13:55

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