• AVR Freaks

Hot!Emulating I2C EEPROM for debugging

Author
Captain Jack
New Member
  • Total Posts : 2
  • Reward points : 0
  • Joined: 2019/03/31 10:08:17
  • Location: 0
  • Status: offline
2020/10/17 00:31:08 (permalink)
4 (1)

Emulating I2C EEPROM for debugging

Hi all,

I have some assembly PIC16F84 code, which interfaces with a 24C16 EEPROM for some data during program execution. The code works fine in circuit.

However, I would like to debug/trace through the code in MPLAB to see the data flow - which works fine until it tries to access data from the EEPROM. Is it possible to emulate the EEPROM in MPLAB that the virtual PIC could read/write data from? I haven't found an obvious way to do this (but I am relatively new to MPLAB).

Thanks
CJ
#1

4 Replies Related Threads

    ric
    Super Member
    • Total Posts : 28943
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: online
    Re: Emulating I2C EEPROM for debugging 2020/10/19 12:52:10 (permalink)
    0
    Are you talking about MPLAB 8 (presumably v8.92, which was discontinued years ago), or MPLABX ?
     
    Either way, neither has has strong support for external chips in the simulator, which is the only place you could "emulate" something.
    The ancient PIC16F84 does not have support for in circuit debugging.
     
     
     

    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #2
    upand_at_them
    Super Member
    • Total Posts : 739
    • Reward points : 0
    • Joined: 2005/05/16 07:02:38
    • Location: Pennsylvania
    • Status: online
    Re: Emulating I2C EEPROM for debugging 2020/10/19 12:55:41 (permalink)
    +1 (1)
    People need to learn "old school" debugging techniques, such as turning an LED on/off.
    #3
    dan1138
    Super Member
    • Total Posts : 3990
    • Reward points : 0
    • Joined: 2007/02/21 23:04:16
    • Location: 0
    • Status: offline
    Re: Emulating I2C EEPROM for debugging 2020/10/19 14:11:22 (permalink)
    0
    There have been requests that Microchip provide simulation objects for common peripheral chips like I2C RTCC chips, EEPROMS, temperature sensors and others for at least 20 years.
     
    The simulation tools group has enough trouble getting a simulator that barely works some of the time. There are what I consider bugs in the simulation models for almost all of the 8-bit PIC controllers supported by the Microchip simulator. I would approach with fear and dead anything they would produce that is not actually built in to the silicon.
     
    My petty sniping aside, it is possible to do what you suggest within the Simulation Control Language(SCL) but this is poorly documented with MLPABX and not documented at all in MLPAB v8.xx. I did use the SCL in MPLAB v8.xx for a project and it definitely was not worth the effort.
     
    I have not seen anyone post an SCL simulation model on this forum so I doubt there is any interest in someone doing this for you.
     
    You could just be glad you have working real hardware.
    #4
    Captain Jack
    New Member
    • Total Posts : 2
    • Reward points : 0
    • Joined: 2019/03/31 10:08:17
    • Location: 0
    • Status: offline
    Re: Emulating I2C EEPROM for debugging 2020/10/20 01:46:02 (permalink)
    0
    Ouch! I am using MPLAB X, debugging some pretty old code, which relies on data in the external EEPROM. Probably easier to port the code to a device with more internal memory and do debugging that way.
    #5
    Jump to:
    © 2020 APG vNext Commercial Version 4.5