Jump to content
Sign in to follow this  
rlang

Well Done!

Recommended Posts

Well done!! I developed the program below to read some data out of the internal EEPROM on a PIC16F8X microprocessor. As I was single stepping through the program looking at the registers, memory and EEPROM everything seemed to be working fine. I was initially concerned that the RD bit was not being set. Upon further reading, I found that the RD bit is reset by the PIC hardware automatically after the read. Congradulations on having such an accurate simulation.

 

#include <system.h>

 

#pragma DATA 0x2100, 92, 3, 'P', 0, 'i', 0, 'c', 0, '1', 0, '6', 0, 'C', 0, '7', 0, '4', 0, '5', 0, '/', 0, //STRING2

'7', 0, '6', 0, '5', 0, ' ', 0, 'U', 0, 'S', 0, 'B', 0, ' ', 0, 'S', 0, 'u', 0,

'p', 0, 'p', 0, 'o', 0, 'r', 0, 't', 0, ' ', 0, 'F', 0, 'i', 0, 'r', 0, 'm', 0,

'w', 0, 'a', 0, 'r', 0, 'e', 0, ',', 0, ' ', 0, 'V', 0, 'e', 0, 'r', 0, '.', 0,

' ', 0, '1', 0, '.', 0, '0', 0, '0', 0

 

char read_eeprom ( char addr ) //---- Read eeprom -----

{

eeadr = addr; // set address register

set_bit(eecon1, RD ); // read command

return (eedata);

}

 

void main()

{

char mydata;

unsigned char i;

trisb=0;

for (i=0;i<92;++i){

mydata=read_eeprom(i);

portb=mydata;

}

}

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...