----- Original Message ----- From: "Herbert Graf" To: Sent: Sunday, August 22, 2004 11:34 AM Subject: Re: [EE]: Zilog Circuit Cellar Kit > On Sun, 2004-08-22 at 12:07, Jean-Michel Howland wrote: > > Herb, I did this several months ago on my dev kit using assembler and it > > produced way way over 50kHz. I'll try and setup the dev board on my bench > > this week and give you an exact number. > > > > Regards > > Jean-Michel. > > Well, for what it's worth, I was able to speed it up slightly by doing > the following: > > PA_DR |= (byte)0x80; > > Weird how you have to prod the compiler to generate something it should > have inferred fro the PA_DR register which is only 8 bits. > Typical C. Everything in an expression is promoted to the largest type in the expression before the operation. The register should also be declared as volatile, or the compiler can optimize it out, or reorder statements. I bet the Zilog includes do this by default, but you should check. > Still, even with that, I only get a speed of 250kHz, still WELL below > what I'd expect of a processor running at 50MHz, that's still 200 cycles > just to flip a bit back and forth. TTYL > You might want to try it in asm, just to see if its any faster. The io call is probably whats getting you. You can often embed asm statements in C code using some kind of asm("stmt") statement. There may also be compiler optimization options you can enable. These might allow the compiler to forgo setting up the index register repeatedly. best luck -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body