![]() |
![]() |
![]() |
|
|
|||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
|
|
Thread Tools | Display Modes |
|
|
(permalink) |
|
This is pretty hard but need to find a way to do.
I have 100 eeprom saved data.I need to create a table from this values. I can read the eeprom values & load into GP registers.But my main program working with these registers.So I cannot use these registers. So I need a way to create a table using these EEPROM values. |
|
|
|
|
|
|
(permalink) | |
|
Quote:
The required command for the table is RETLW, with a calculated jump using PCL. 100 entries is easy, but you must ensure it doesn't cross a 256 word boundary, or you have to take special precautions (again, my tutorials, LED matrix, gives examples of large tables). |
||
|
|
|
|
|
(permalink) |
|
Hi Nigel thanks for the info.You didn't get my problem.
I need to create a table using my EEPROM saved values. From these saved data I need to create a table. |
|
|
|
|
|
|
(permalink) | |
|
Quote:
Whats the PIc type.? If the values exist in EEPROM, why do you need to create a Table in the registers.
__________________
Eric "Good enough is Perfect" PIC tutorials: Gramo's: www.digital-diy.net/ Bill's: www.blueroomelectronics.com/ |
||
|
|
|
|
|
(permalink) |
|
|
|
|
|
|
|
|
(permalink) | |
|
Quote:
Whats the purpose of the Table, why cant you use the values in the EEP.? Why do you have to Tabulate them.
__________________
Eric "Good enough is Perfect" PIC tutorials: Gramo's: www.digital-diy.net/ Bill's: www.blueroomelectronics.com/ |
||
|
|
|
|
|
(permalink) |
|
You need to explain what you are trying to do. Your EEPROM data is already a table, moving it to SFRs or Rom will make no difference. What do you want to do with the values in EEPROM?
Mike. |
|
|
|
|
|
|
(permalink) |
|
Hi in my main menu theres such a thing like this.
Code:
Shift movf data1,W movwf data2 movf data2,W movwf data3 --- --- So again I have to read the EEPROM 100 saved places. That is why I need to create a table. |
|
|
|
|
|
|
(permalink) |
|
Why can't you move the values from the EEPROM into the data variables?
Mike. |
|
|
|
|
|
|
(permalink) |
|
|
|
|
|
|
|
|
(permalink) |
|
hi Mike,
I will just observe, dont want to confuse Suraj with multiple replies.
__________________
Eric "Good enough is Perfect" PIC tutorials: Gramo's: www.digital-diy.net/ Bill's: www.blueroomelectronics.com/ |
|
|
|
|
|
|
(permalink) |
|
Yes, although there isn't 100 consecutive location in a 628, you could use locations 0x5c-0x6f (20 bytes) in bank 0 and the 80 bytes in bank 1.
Do you understand how the FSR register works? With the FSR register you can move the EEPROM values into the SFRs by doing, Code:
data1 equ 0x5c data21 equ 0xa0 MoveData movlw data1 ;point indirect register movwf FSR ; at data 1 bcf STATUS,IRP ;ensure we write to bank 0 and 1 bsf STATUS,RP0 ;bank 1 clrf EEADR ;start at location zero MoveLoop bsf STATUS,RP0 ;Bank 1 bsf EECON1,RD ;EE Read movf EEDATA,W ;W = EEDATA incf EEADR,F ;point to next location bcf STATUS,RP0 ;Bank 0 movwf INDF ;write to SFRs incf FSR,F ;move to next location movfw FSR xorlw data1+d'20' ;end of bank 0 data? btfss STATUS,Z goto NextCheck movlw data21 ;yes, so point FSR at next bank movwf FSR NextCheck movfw FSR xorlw data21+d'80' ;end of all data btfss STATUS,Z goto MoveLoop ;no carry on return ;done. The above is untested code and may not work. I state this as I will not be able to correct it if it turns out to be flawed due to the 15 minute edit time. Mike. |
|
|
|
|
|
|
(permalink) |
|
|
|
|
|
|
|
|
(permalink) |
|
__________________
Eric "Good enough is Perfect" PIC tutorials: Gramo's: www.digital-diy.net/ Bill's: www.blueroomelectronics.com/ |
|
|
|
|
|
|
(permalink) |
|
Hi Mike Excellent code.That is what I was expecting.
I was looking a method how to place saved data in a one place.The above code of you allow to do that.So no need to create a table. Thanks for the support. |
|
|
|
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Latest |
| Create a children's table? | jpanhalt | Feedback/Comments | 6 | 11th December 2007 10:45 PM |
| Want to create two signals..... | aidantmurphy | General Electronics Chat | 1 | 15th February 2005 05:26 PM |
| This is how to create schematics | williB | General Electronics Chat | 10 | 13th December 2004 12:30 AM |
| truth table vs lookup table | alamy | Micro Controllers | 14 | 16th June 2004 07:48 PM |
| Simple Table Read and Table Write for PIC18F452 | daveboy | Micro Controllers | 1 | 17th July 2003 08:43 PM |