|
From: van de W. M. (D. PH) <M.V...@ca...> - 2001-06-11 04:06:36
|
I know this is (slightly) OT, but here goes anyway:
Has anyone used this chip (AT89S8252) successfully? I have a couple of these
on a dev. board (minimal) of my own design. I can't work out what's going
on, any pointers would be most appreciated.
No matter what program I put in (serially programmed using a program I d/l
from the 'net - reading a program after writing gives the same file), All I
get is this:
* Running 24MHz XTAL --> looks good on the 'scope.
* Port 0 --> strange oscillations on this port (with 10k pull-ups), at
around 2MHz, with a single spike followed by a longer (double-length) spike
(500ns, then 500ns low, then 1usec high, then 500nsec low, then 500nsec
high, etc).
* Port 2 --> 2.0 has a 3.9kHz sq. wave; 2.1 has 1.95kHz sq. wave, and so on,
halving in frequency up to p2.7.
* Ports 1&3 seem to have random values assigned.
Here's *one of* the programs I used to program it with:
== 8>< =================================================
#include <at89S8252.h>
#define clock 24000000
#define irqfreq 10000
//volatile bit tick;
main()
{
P2=0;
P1=0xFF;
P0=0xFF;
P3=0xFF;
while(1)
{
P2++;
}
}
== 8>< =================================================
Note that I can put any delay in the while() loop, but it doesn't seem to
change the frequency of the counter on port 2. I can also completely remove
the counter, and port 2 still counts up!!
I've put pull-ups (10k) on all the ports, only because the outputs aren't
going anywhere on my board - before I put pull-ups on port 0, I got absolute
garbage (as opposed to the non-random garbage I'm getting now).
Note that I haven't got the board working at all yet, so it may be a
hardware problem; I think I've followed all the guidelines in the data
sheet, but if there's anything strange about this chip I'd be happy to know
it.
Any pointers would be very gladly received (also please email to
mv...@on...)
Cheers,
Matthew van de Werken
Electronics Engineer
CSIRO Exploration & Mining - Gravity Group
1 Technology Court - Pullenvale - Qld - 4069
ph: (07) 3327 4685 fax: (07) 3327 4455
email: m.v...@ca...
|