----- Original Message -----=20 From: "Josh Koffman" To: "Microcontroller discussion list - Public." Sent: Tuesday, September 13, 2011 6:39 AM Subject: Re: [PIC] Program Memory Data Table On Mon, Sep 12, 2011 at 11:51 PM, IVP wrote: >> And my (possibly faulty) understanding is that it will read >> the least significant byte first, so I'd have to take care to >> swap the high and low bytes in the table - ie: >> >> data 0xBYTE2BYTE1, 0xBYTE4BYTE3 >> >> Uh...how far off am I? > > I got into an awful pickle using 'data' and ASCII strings with > unprintable characters (eg 0a, 0d) that were inserted as 0x > values when I forgot to do that Could I list them separately though? data 0xXX, 0xXX, 0xXX, 0xXX Josh --=20 A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools. -Douglas Adams Hi Josh koffman wrote >Could I list them separately though? >data 0xXX, 0xXX, 0xXX, 0xXX This makes sense when using Bytes and the reading sequence you've describe= =20 is correct 'data 0xBYTE2BYTE1, 0xBYTE4BYTE3' I am in progress of making a controller to run two step motors to control m= y=20 telescope. I need to ramp up gently and uses a DATA table with precalculate= d=20 TMR- values. The step motors share the table and uses TMR0 and TMR1 for=20 speed controll. I used Excell to make the tabel, approx 1600 words, and=20 then copyed the values in 14 words /line, and added 0x.... to every word,= =20 so they look like 0x23FA.. and so on, very tedious, it took an whole=20 evening. The TBLRD*+ and - gave me a real headache, as I also used the=20 table when ramping down. I am not shure if the pickup routine is working=20 correctly yet. The routine tends to 'overshoot' at the end in either=20 direction, because I also need be able to stop and start several times, in= =20 the middle of a ramp up or down. I keep my Data as 14 word/ line in order to make them readable when=20 printing. I am using the 18F452 processor I have not figured out how to calculate the Values 'on the fly' not given i= t=20 much thoughts thoug, as i don't think there is time enough --=20 Bjarne Lassen http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .