Article View: sci.electronics
Article #6200DS5000 question
From: David R Hucke
Date: Fri, 14 Aug 1992 01:38
Date: Fri, 14 Aug 1992 01:38
58 lines
2111 bytes
2111 bytes
Hi everyone:
Got a question or two about an 8051 problem (DS5000 actually).
I have an LED hooked up to P0.0 through a PNP transistor buffer. This
part is fine. I have a a resistor (330 Ohms) hooked up to P0.1 which can
be set to ground of +5v.
Below is my program, it should do the following,
1) Turn of the watchdog timer (disable it).
2) Enable P0.1 as an INPUT by writing a 1 to it.
3) Turn off the LED at P0.0
4) When P0.1 goes high, the LED should light up.
5) When P0.1 goes low, the LED should turn off.
This is not what is happening. What is happening is that the LED never
turns completely off and the LED sometimes lights up when I put P0.1 to
ground. After about approx 5-10 seconds, I have to reset the DS5000 to
get any results at all. And sometimes the LEDs turns on and off rapidly.
Generally speaking, the results seems to be quite random.
Could somebody tell what could be wrong either with my program, hardware, or
both? Note: My DS5000 is rated at 12 Mhtz, but I have it running at 8 Mhtz.
====== Program begins here ========
.org 0
anl h'087, #b'11111011 ;;; Turn Watchdog off
setb P0.0 ;; Turn LED on
setb P0.1 ;; P0.1 is now an INPUT
sjmp loop
RING:
;; clr P0.0; Turn LED on.
cpl P0.0 ;; P0.0 = NOT P0.0
ret
NORING:
;; setb P0.0; Turn LED off.
cpl P0.0 ;; P0.0 = NOT P0.0
ret
loop:
jnb P0.1,RING
jb P0.1,NORING
acall loop
.end
==== End program ====
Thank you very much.
--
pegasus@csd4.csd.uwm.edu
--
pegasus@csd4.csd.uwm.edu David R. Hucke
UW-Milwaukee Film Major
--
Technical Details
Message-ID:
<1992Aug14.013841.20246@uwm.edu>Path:
arc1-ca.pugleaf.net!sparky!uunet!caen!uwm.edu!csd4.csd.uwm.edu!pegasusShow Full Headers
Complete Article Headers
Newsgroups: sci.electronics Path: arc1-ca.pugleaf.net!sparky!uunet!caen!uwm.edu!csd4.csd.uwm.edu!pegasus From: pegasus@csd4.csd.uwm.edu (David R Hucke) Subject: DS5000 question Message-ID: <1992Aug14.013841.20246@uwm.edu> Originator: pegasus@csd4.csd.uwm.edu Sender: news@uwm.edu (USENET News System) Organization: Computing Services Division, University of Wisconsin - Milwaukee Date: Fri, 14 Aug 1992 01:38:41 GMT Lines: 58