Jump to content
Sign in to follow this  
jvgelder

16F873  Data EEprom paging problem

Recommended Posts

I have problem's with the internal data Eeprom of the 16F873 when everything is compiled and you look  in the .asm file you see that the bank is  bank 0 and bank 1 and not bank 2 and bank 3.

 

   :)

Share this post


Link to post
Share on other sites
Guest Pavel

I don't yet see any problem. Your code may not use any registers from banks 2&3. Please post some code that will expose the problem.

 

Regards,

Pavel

Share this post


Link to post
Share on other sites
Guest jvgelder

/* just a piece of simple code to test the bank switching for data EEprom */

 

 

 

void main(void)

{

  EEADR=12;        // IS ON  BANK 2     0X10D

  EEDATA=23;       // IS ON  BANK 2     0X10C

 

  EECON1 = 23;     // IS ON BANK 3      0X18C

  EECON2 = 22;     // IS ON BANK 3      0X18D

}

 

 

///////////////////////////////////////////////////

// GENERATED CODE POINTS NOW TO BANK 0 AND BANK1

// THIS MUST BE :

// RP1 = 1 RP0 = 0  FOR EEDATA AND EEADR

// RP1 = 1 RP0 = 1  FOR FOR EECON1 AND EECON2

///////////////////////////////////////////////////

 

 

   

; This file was generated by C2C-plus compiler version 5.2e

 

include "p16F873.inc"

;Variables *****************************************

ORG 0

goto startcode

;;;;;;;;

;;;;;;;;void main(void)

_mainend

const_ptr_data

END

Share this post


Link to post
Share on other sites
Guest Pavel

This is not a bug. You use built-in variables which are mapped to the PIC16F84 address space. Generally it's not recommended to use built in variables (the documentation points on this and also the compiler prints a warning). Instead you should use variables declared in the sytem header.

 

Regards,

Pavel

Share this post


Link to post
Share on other sites

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...