Menu

indirection address (0xFFFF) for INDF1 regist

Help
Chris
2012-09-29
2013-05-30
  • Chris

    Chris - 2012-09-29

    im having a problem with a very large program im making. every time i simulate it im getting the error "PC=0x0A7C indirection address (0xFFFF) for INDF1 register is outside writable data memory - no write occurs"

    this simulation error repeats over and over, the same message except for the "PC=0x0A7C" each time that part is different, seems this error happens each time the PC in incremented. these are the vales that are different for each error
    PC=0x0A7C
    PC=0x0A7D
    PC=0x0A7E
    PC=0x0A7F
    PC=0x0A80

    the chip im using is 16f1938, im using

    i think it has something to do with writing to an lcd, a sub routine in the program sends a lot of characters to the lcd, and nothing else. when i remove this sub routine the program simulates fine with no errors.

    these are the variables im using in case that is whats causing my problem. i can post some of the .lst file if need be. any help would be greatly appreciated

    Dim counter As byte
    Dim seconds_old As byte
    Dim seconds_var As byte
    Dim minutes_var As byte
    Dim hour_var As byte
    Dim am_pm As bit
    Dim temp As byte
    Dim month_var As byte
    Dim year_var As byte
    Dim seconds_difference As byte
    Dim rps_var As byte
    Dim revs_temp As word
    Dim rpm_var As word
    Dim speed_counter As byte
    Dim wheel_diameter As byte
    Dim rps(6)
    Dim total_miles As word
    Dim miles_per_hour As word
    Dim feet_per_rev As word
    Dim menu_selection(2)
    Dim menu_depth As byte
    Dim current_display As byte
    Dim backlight_level As byte
    Dim main_counter As byte
    Dim timer_temp As byte
    Dim current_button As byte
    Dim device_code As byte
    Dim receive_temp As byte
    Dim receive_counter As byte
    Dim button_set As byte
    Dim battery_level As byte
    Dim battery_level_temp As byte
    Dim battery_level_local As byte
    Dim battery_level_local_temp As byte
    Dim in_sleep As bit
    Dim sleep_counter As byte
    Dim system_armed As bit
    Dim time_counter As byte
    Dim time_temp As byte
    Dim time_ten_temp As byte
    Dim display_string As string
    
     
  • kent_twt4

    kent_twt4 - 2012-09-29

    Looks like a blip in the 16f1938 and 16lf1938 chipdata files.  The last group of data ram location is wrong.  Change 620:34F to 620:64F and save it.

     
  • Chris

    Chris - 2012-09-29

    ive had that suggested before because of a previous problem, ive already corrected that mistake in my chipdata file, the problem seems to be with the length of arrays. i was sending "system armed" to the lcd, i changed that to "armed" and i dont get the error in the simulator anymore. when using the command to print to an lcd does it store what its sending to the lcd in a string? maybe this problem im having is with the length of the string im sending.

    maybe sending "system armed" would probably use 12 bytes, one for each letter. maybe this is too much to store, i have a feeling it stores it indirectly? i mean i have no clue how the microchip handles these things, but i get no error when compiling. maybe i can work around this by sending "system " and "armed" seperately

     
  • Chris

    Chris - 2012-09-30

    im still having this problem, it only seems to be a problem when my code gets larger. the simulator is saying the instruction being executed is "MOVWI 63d," with the same error

     
  • Chris

    Chris - 2012-09-30

    this problem is seeming like a program size limitation, or a limitation on how many sub routines (not the depth of sub routines, because im not running into stack over/underflow and i dont have any subs nested more than 2 deep). it could also be that im doing too many calculations within 1 variable definition, here is an example of 1 of my large calculations, maybe someone cas tell me if theres a limit on how many different expressions can be handled at once. "miles_per_hour=((rpm_var*6)*7)/528" and i have an if statement with a calculation in it which is this "if revs_temp=>5280/(((menu_variable(3)*314)/100)/12)" . this project is all part of a speedometer/security system im trying to design, im not even going over 3kb of space and this chip i have has a lot of space on it, id like to be able to use most of it. if i remove certian parts of the code i no longer get this indirection address error. sometimes when i remove something it suddenly tells me my program is too large, sometimes itll run fine if i remove certian parts. this is becoming highly frustrating, ive been able to work out a lot of the problems ive had with GCB but this one has become a serious issue. i really dont wanna move to a different program to program my microchips, ive gotten so used to using this that it would be difficult to move to a different one. i hope someone can help, strange that im the only one having this problem, maybe ill try simulating for a different chip and see if the problem persists

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.