Two things I see. First, tables I have as DT in ASM (you didn't say which language you're using). Then again, I'm using tables such as "dt 0,1,1,2,3,3,....etc" as opposed to separate lines. Second, you need a "RLNCF WREG,1" line before the table since PIC18s use two-byte counters. Again, this is in ASM, but you should need to do the same thing in any language (multiply the index by 2). When I used separate lines, each one was using a RETLW then the data. Not sure if this will help or not, but it may spark the answer as has happened to me several times on the list. Joe M. Josh Koffman wrote: > Hi all. Well, now that I'm on my way converting binary to BCD, I'll > next need to convert from BCD to 7 segment display. I will do this > with a lookup table. In order to make my code easier to read, I tried > to put each value in the table on its own line. For example: > > db b'01010101' ; some character > db b'10101010' ; some other character > db b'111111111' ; yet another character > > However when I tried to use this, it didn't seem to work. I only > seemed to be able to return a 0 for anything after the first entry. > Switching to: > db b'01010101', b'10101010', b'1111111' > seemed to make the difference. I admit I'm not really sure why though. > The table has about 20 entries, so even if I was having some problem > with bytes vs words I should have had some garbage, not all zeros. > > I'm sure I'm missing something simple here, but I can't figure it out! > All of the examples I have managed to find list all the data in the > same db line. This seems really unwieldy for a large table though. > This is on a PIC18F by the way. > > Thoughts? > > Josh > > > ------------------------------------------------------------------------ > > > No virus found in this incoming message. > Checked by AVG - www.avg.com > Version: 9.0.733 / Virus Database: 271.1.1/2690 - Release Date: 02/15/10 14:35:00 > -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist