Alex_rcpilot
Member
Jay.slovak said:How about passing a parameter from Interrupt (remember this will not act as RETFIE, as GIE is not being enabled automatically) or other Sub-routine?
EDIT: That interupt passing thingy is kind of useless :lol:
Oh yeah I think it will contribute under certain circumstances.This solution is also implemented in other microcontroller families.
eblc1388 said:Nothing ?
Be careful when your table is larger than one page(256 bytes), not starting on a page boundary, larger than 512 bytes...etc..
It is getting messy with the correct PCL and PCLATH. Microchip AN556 is the document about what to watch out for with table read.
:roll: Don't worry,my friend.I can handle that.I will consider all related registers that have something to do with the boundaries.Actually there is a section describing such circumstances in detail in my text book.I may use it as a reference.
Nigel Goodwin said:Yes, that's what I meant, the Harvard architecture of the PIC keeps data and program completely seperate - which makes tables rather difficult, the RETLW instruction can be used to provide a program structure that contains data.
But the RETLW structure is perfectly capable of doing what you require, if you have a look at **broken link removed** then they use RETLW to store large amounts of data to generate maps on a graphic LCD.
As already suggested, you have to take account of the 256 byte boundary problems, but the EPE code does just that (using almost all the program space for data).
Hm....I wouldn't agree with what you said about how difficult it is to manage data table in program memory for Harvard architectured processors.Actually when we talk about tables within a microcontroller,we ARE talking about data stored inside program memory.Besides MCS-51 and AVR microcontrollers are also Harvard architecture based microcontrollers.They both deal with tables well,through a certian instructions(MOVC A,@A+DPTR for 8051&LPM for AVR).As Jay said,PIC18 has similar and even more powerful instructions,too-"TLRD t,f" and "TLWT t,f".For some reason this instruction is not implemented on all PIC chips.But it doesn't mean it can't be done.Presumably it's what makes PIC special,that makes PIC the real RISC microcontrollers.
Anyway I'm happy with the DT directive.It will make generating RETLW tables a lot easier.With this directive I don't feel too sorry about instructions like TLRD when I use 16F and there isn't any.
BTW,I tried opening the FTP,but each time I hit enter the IE freezes.Is there an http link for the info?Thanks!
Regards,Alex.[/quote]