Re: [Fx2lib-devel] Some bugs
Status: Beta
Brought to you by:
mulicheng
From: Maarten B. <sou...@ds...> - 2009-07-28 08:47:48
|
Dennis, >> 2. usbjt.a51 has several areas defined without specifying the memory >> type. >> I advise to change them to (CODE, ABS, CON) so they will not end up in >> xdata by accident and the linker can check for overlaps. > > Which areas? _INT2AV,_INT4AV are ( ABS, OVR ) So they are at an ABSolute address and OVeRlayable by any other area. In what memory should the linker put it? XDATA? Or IDATA? Have you found in the asxxxx documentation that it defaults to CODE memory? And what do you think will happen if another area is put at the same address as this one? You've told the linker that this is OK. > For INT2JT, I specifically didn't put the .org in because it has to be > aligned on a page boundary and I didn't have a way to get the compiler > to put that in the correct location without telling the linker > specifically about it. By the way, INT2JT is declared as: > .area INT2J2 ( CODE ) > > I specify the INT2JT location in the firmware Makefile like this: > > sdcc -Wl"-b INT2JT 0x 0x3000" > > Is there a better way to do it? I think this is ok. >> Or if you want even more precise timing either fully write the >> function in >> asm or use a timer. > > I've struggled a little with the use of timers. Not how to use them, > but whether or not to use them. I like the idea of a better > resolution delay with timers but I don't like the idea of limiting the > usage of timers for other purposes. For instance, right now, the > serial code uses timer 2. If you want to use timer 2, you can't use > the serial code. Suppose I use timer 1 for a delay. Can you now not > use a timer for something else? > > Perhaps you have some suggestions on this subject. I know one > improvement would be to use the fx2 high speed baud generation timer > instead of timer 2. I don't think there are many other usages for > that timer than for serial IO. Using the baud generation timer will free the other timer for other uses. And since it is an fx2 lib I assume you don't need to worry about backward compatibility if the baud generator isn't there, right? For general not too fast timing I usually setup one millisecond timer and in its ISR set several signals to indicate one ms has passed. Then in the main loop round-robin task you check if the signal is set, clear it and react as needed. But beware this prevents using a blocking loop like the delay function is right now. Maarten P.S. You might want to change the "reply to" address, because my mailer wanted to reply to you personally instead of the mailing list. |