Posted by Leon Heller December 4, 2003
Using the latch has eliminated nearly all the glitches. The remaining ones
are very small and probably won't matter. I'll try to get rid of them,
anyhow.

Thanks to everyone for their help.

Leon
--
Leon Heller, G1HSM
Email:
http://webspace.webring.com/people/jl/leon_heller/



An Engineer's Guide to the LPC2100 Series

Posted by microbit December 3, 2003
I think the server gets silly at times, or whatever.
There was a stage very recently where I didn't get posts from the CW430
group for like 12 days,
and then the stream just started again.
I know it's not my end, because as far as I know the Yahoo servers suspend
posting to you
after a "bounced" Email, until you re-confirm you're a valid destination.

I had however RXd Ben's posts, but they were always blank with an
attachment.
McAfee didn't have problem with it, but unsolicited attachments _always_ go
straight to
the bin AFAIAC.

I only realised when I looked on the LPC2100 group page ......

-- Kris

----- Original Message -----
From: "otc_friend" <>
To: <>
Sent: Thursday, December 04, 2003 10:33 AM
Subject: Re: [lpc2100] Re: DDS working I have the same feeling.
- Henry

-----Ursprgliche Nachricht-----
Von: leon_heller <>
An: <>
Datum: Mittwoch, 3. Dezember 2003 19:31
Betreff: [lpc2100] Re: DDS working >--- In , "microbit" <microbit@c...> wrote:
>> Hmmm, I didn't see the post of Ben, seems like I'm in the same boat
>> as Robert here :-)
>> Obviously not all posts are always routed fully to every member.
>
>I have the same problem as well. They appear almost immediately on the
>group's web page, but sometimes the emailed version takes a long time.
>I've got a feeling that Yahoo sends them out periodically, not when
>they are initially posted. I've noticed it with other groups.
>
>Leon
>
>
>
>To unsubscribe from this group, send an email to:
>
>
>
>
>">http://docs.yahoo.com/info/terms/
>
>

To unsubscribe from this group, send an email to:



Posted by otc_friend December 3, 2003
I have the same feeling.
- Henry

-----Ursprgliche Nachricht-----
Von: leon_heller <>
An: <>
Datum: Mittwoch, 3. Dezember 2003 19:31
Betreff: [lpc2100] Re: DDS working >--- In , "microbit" <microbit@c...> wrote:
>> Hmmm, I didn't see the post of Ben, seems like I'm in the same boat
>> as Robert here :-)
>> Obviously not all posts are always routed fully to every member.
>
>I have the same problem as well. They appear almost immediately on the
>group's web page, but sometimes the emailed version takes a long time.
>I've got a feeling that Yahoo sends them out periodically, not when
>they are initially posted. I've noticed it with other groups.
>
>Leon
>
>
>
>To unsubscribe from this group, send an email to:
>
>
>
>
>">http://docs.yahoo.com/info/terms/
>
>




Posted by leon_heller December 3, 2003
--- In , "microbit" <microbit@c...> wrote:
> Hmmm, I didn't see the post of Ben, seems like I'm in the same boat
> as Robert here :-)
> Obviously not all posts are always routed fully to every member.

I have the same problem as well. They appear almost immediately on the
group's web page, but sometimes the emailed version takes a long time.
I've got a feeling that Yahoo sends them out periodically, not when
they are initially posted. I've noticed it with other groups.

Leon


Posted by Ben Dooks December 3, 2003
On Wed, Dec 03, 2003 at 01:20:50PM -0500, Robert Adsett wrote:
> At 05:20 PM 12/3/03 +0000, you wrote:
> >if you wanted to get better IOSET/IOCLR then you could do
> >
> > while (1)
> > {
> > unsigned int val, vali;
> >
> > acc = acc + adder; //update phase accumulator
> > ptr = (acc &= 0xFF); //pointer into table
> > val = swatooth[ptr] << 8; // get our value
> > vali = ~val;
> >
> > // set our value onto the output lines..
> > IOSET = val;
> > IOCLR = vali;
> > }
> >
> >which should pre-compute the inverse of val and then do the
> >set of the two registers. You could possibly get a little more
> >perfomance to go to assembly.
>
> Even with assembly I would expect to see a significant glitch. Even at max
> speed I was seeing several hundred nS to perform both operations. (see
> earlier thread of discussion "Simple test program - is now instruction")

yeah, the best way is to use some form of latch to clean the signal up.

--
Ben

Q: What's a light-year?
A: One-third less calories than a regular year.



Attachment (not stored)
attachment
Type: application/pgp-signature

Posted by microbit December 3, 2003
Hmmm, I didn't see the post of Ben, seems like I'm in the same boat
as Robert here :-)
Obviously not all posts are always routed fully to every member.

-- Kris

----- Original Message -----
From: "leon_heller" <>
To: <>
Sent: Thursday, December 04, 2003 5:15 AM
Subject: [lpc2100] Re: DDS working >
>
> >
> > which should pre-compute the inverse of val and then do the
> > set of the two registers. You could possibly get a little more
> > perfomance to go to assembly.
>
>
> Thanks, Ben. That speeded it up somewhat. Compiling for Release rather
> than Debug made a big difference as well.
>
> I've never used C before for this sort of thing, it probaly shows.
>
> Leon





Posted by Robert Adsett December 3, 2003
At 05:20 PM 12/3/03 +0000, you wrote:
>if you wanted to get better IOSET/IOCLR then you could do
>
> while (1)
> {
> unsigned int val, vali;
>
> acc = acc + adder; //update phase accumulator
> ptr = (acc &= 0xFF); //pointer into table
> val = swatooth[ptr] << 8; // get our value
> vali = ~val;
>
> // set our value onto the output lines..
> IOSET = val;
> IOCLR = vali;
> }
>
>which should pre-compute the inverse of val and then do the
>set of the two registers. You could possibly get a little more
>perfomance to go to assembly.

Even with assembly I would expect to see a significant glitch. Even at max
speed I was seeing several hundred nS to perform both operations. (see
earlier thread of discussion "Simple test program - is now instruction")

Robert

" 'Freedom' has no meaning of itself. There are always restrictions,
be they legal, genetic, or physical. If you don't believe me, try to
chew a radio signal. "

Kelvin Throop, III



Posted by leon_heller December 3, 2003


>
> which should pre-compute the inverse of val and then do the
> set of the two registers. You could possibly get a little more
> perfomance to go to assembly.


Thanks, Ben. That speeded it up somewhat. Compiling for Release rather
than Debug made a big difference as well.

I've never used C before for this sort of thing, it probaly shows.

Leon


Posted by Ben Dooks December 3, 2003
On Wed, Dec 03, 2003 at 11:14:07AM -0500, Robert Adsett wrote:
>
> > while (1)
> > {
> > acc = acc + adder; //update phase accumulator
> > ptr = (acc &= 0xFF); //pointer into table
> > IOSET = sawtooth[ptr] << 8;
> > IOCLR = (~sawtooth[ptr] << 8);
> > }
> >
> >apart from glitches - spurs on the waveforms. I think I had the ~ in the
> >wrong place.
> >
> >I didn't get those glitches with the AVR, using the same DAC.
>
> Scope your output lines and compare to the glitches. I suspect they are
> coming from the fact that not all of your lines change at the same
> time.

yeah, I pointed out the code being produced is loading the table
value twice, which is why I suggested that the sawtooth[ptr]
be loaded into a temporary variable and used.

ie:

while (1)
{
unsigned int val;

acc = acc + adder; //update phase accumulator
ptr = (acc &= 0xFF); //pointer into table
val = swatooth[ptr] << 8; // get our value

// set our value onto the output lines..
IOSET = val;
IOCLR = ~val;
}

if you wanted to get better IOSET/IOCLR then you could do

while (1)
{
unsigned int val, vali;

acc = acc + adder; //update phase accumulator
ptr = (acc &= 0xFF); //pointer into table
val = swatooth[ptr] << 8; // get our value
vali = ~val;

// set our value onto the output lines..
IOSET = val;
IOCLR = vali;
}

which should pre-compute the inverse of val and then do the
set of the two registers. You could possibly get a little more
perfomance to go to assembly.

--
Ben

Q: What's a light-year?
A: One-third less calories than a regular year.



Attachment (not stored)
attachment
Type: application/pgp-signature


Posted by Robert Adsett December 3, 2003

> while (1)
> {
> acc = acc + adder; //update phase accumulator
> ptr = (acc &= 0xFF); //pointer into table
> IOSET = sawtooth[ptr] << 8;
> IOCLR = (~sawtooth[ptr] << 8);
> }
>
>apart from glitches - spurs on the waveforms. I think I had the ~ in the
>wrong place.
>
>I didn't get those glitches with the AVR, using the same DAC.

Scope your output lines and compare to the glitches. I suspect they are
coming from the fact that not all of your lines change at the same
time. Going from a value of 3 to a value of 4 I would expect to see a
sequence of 3, 7, 4 given your code.

I think there may be either a HW or a SW fix. THE SW fix would involve
going against the User manuals recommendations though.

Robert