I actually have a problem with my EEPROM access in the PIC16F877A.
I saved a string of 5 bytes transferred from an SMS received in the handphone to my PIC and saved in EEPROM but when i read these 5 bytes again from the EEPROM and send it to another handphone, i get all 5 bytes showing the "Pound symbol" (Ascii 0x156) instead.
1) I have used the memory locations 0x00-0x04 for the saving of the 5 bytes into EEPROM.
2)I have also taken into consideration the 0xaa and 0x55 special hexcodes
I know I should be posting my code but my code is a thousand lines long and would be pretty inconvenient. So before I get into the details, Im wondering if there's any fundamental issues that i should address first if anyone has ever encountered this same problem
The most common problem with writing to EEPROM is not waiting for the write to finish before doing something else. The simplest way to know if the write is complete is to check the WR bit (in EECON1) and if it's still set then the write hasn't completed and you should wait.
As for code, you could just post the read/write routines.
Edit, BTW how can a byte contain 0x156. The max is 0xff.
yeah that baffles me too. The 5 bytes that appear on my handphone screen is £££££
The most common problem with writing to EEPROM is not waiting for the write to finish before doing something else. The simplest way to know if the write is complete is to check the WR bit (in EECON1) and if it's still set then the write hasn't completed and you should wait.
I know I should be posting my code but my code is a thousand lines long and would be pretty inconvenient. So before I get into the details, Im wondering if there's any fundamental issues that i should address first if anyone has ever encountered this same problem
You can do it that way but that means that in your main code you need to select bank 2. The other way is to select bank 0 in your EEPROM routines before accessing it or place it in the common area at 0x70-0x7f.
The £ sign on a cellphone is encoded as 0x01. The encoding is not ASCII, although it uses the same codes as ASCII for all the usual characters. You certainly store "£" in one EEPROM location if you are receiving from a cellphone.
You should use a programmer to find what you code has written in the EEPROM, if anything.
The £ sign on a cellphone is encoded as 0x01. The encoding is not ASCII, although it uses the same codes as ASCII for all the usual characters. You certainly store "£" in one EEPROM location if you are receiving from a cellphone.
I don't think that the cellphone is accessing the EEPROM that you are working with. As I understand it, you are receiving a text on a cellphone, reading it with a PIC16F877A, and storing the result in the EEPROM on the PIC. Then you are reversing the process, and reading the values from the EEPROM on the PIC, and sending them as part of the text to another cellphone.
I don't think that the default for a cell phone is 0x01. I think that the 0x01 is a result of your code not reading or writing the EEPROM correctly, and £ is how it appears on the cellphone.