Darrel Taylor Interrupts I2C Problem


Closed Thread
Results 1 to 12 of 12

Hybrid View

  1. #1
    Join Date
    Mar 2008
    Posts
    9


    Did you find this post helpful? Yes | No

    Default

    Hi Mr Taylor:

    Please, don't think I'm trying to put my problems on your program, be sure I'm not looking for a guilty, I'm just trying to find a workaround to my problem. Your software is great, and that's what I'm using it, but I have an issue I need to fix. Maybe I need to change the post subject, because I'm not sure where the problem is.

    If you are asking me for the I2C slave, is an specific purpose pic, reading analog inputs and sending it digitalized by I2C protocol, every 20ms.

    Talking about my previous post, I know that VarsSaved_H is set every time you start the handle of an PBP High Priority interrupt. But I can see in your code that you only save the variables "if VarsSaved_H = 0 then" so if VarsSaved_H=1 when you enter the "SavePBP_H" routine you don't save then and VarsSaved_H keeps its value to 1. At the interrupt handling exiting the program again look for VarsSaved_H state to know if it needs to restore variables, as the system see VarsSaved_H=1 it restores some value that nobody has set.
    As long as I can see VarsSaved_H is not initialized anywhere before entering "SavePBP_H" for the first time, so we can't know what value it has. If it is 1 then the problem appears. Are you agree?

    I don't have any doubt that maybe my program has another problems, or maybe the I2C slave is generating me other issues, but I think that VarsSaved_H initialization should be done for a right execution.

    To end, please accept my apologies if my English isn't good enough and you misunderstood my intentions. I'm just trying to find a solution to my problems, and making it public to maybe help other people

    Greetings,
    dcorraliza

  2. #2
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    OK, I see what you're saying dcorraliza.

    I always have a CLEAR statement at the beginning of the program, so it's never been a problem for me.

    I should add your suggestion, for the people that don't use Clear.

    Sorry for the thick head.
    Thanks for the persistence.

    Darrel

    Added:
      I'll also be adding INT_Flags = 0 to the DT_INTS.bas file.
      Thanks again.
    Last edited by Darrel Taylor; - 24th March 2008 at 19:01. Reason: .

  3. #3
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    I imagine there are a lot of people that don't have CLEAR in their programs, so I'm glad you found that dcorraliza.

    I've updated the DT_INTS-18 files to version 3.3

    You can find the new version here ...
    http://darreltaylor.com/DT_INTS-18/downloads.html

    Thanks again,
    DT

Similar Threads

  1. I2C Master/Slave 16F88/16F767 working code
    By DanPBP in forum Code Examples
    Replies: 2
    Last Post: - 23rd October 2012, 23:31
  2. HARDWARE I2C SAMPLE CODE question
    By Michael Wakileh in forum Code Examples
    Replies: 2
    Last Post: - 16th June 2009, 22:07
  3. Another I2C Slave Routine Problem
    By DanPBP in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 19th February 2009, 06:50
  4. I2C Master Slave issues.
    By cpayne in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 29th March 2008, 20:33
  5. I2C eeprom and DS1307 @40MHz problem
    By ius01 in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 20th July 2007, 08:41

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