Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
09/25/06 03:40
Read: times


 
#124955 - Better answer
Responding to: ???'s previous message
Sorry Kai, I wil give you a better answer.

Clock is 24mhz, EA is connected to VCC. The circuitry consists of a 40 pin zif socket that already has surrounding circuitry connected. I use it to test various chips. I use it for my 89C55 as well as 89C52. I use a universal programmer to program them first before inserting into the socket and testing.

To flash the LED I use a 470 ohm resistor connected to VCC and the other end connected to the led which is connected to a port pin. The 89C52 and 89C55 work fine in this setup but not any of my 89S8252. The code is the same code that works in the other chips.

#INCLUDE "8051EQU.INC" ;include predefined constants
;
;**************************************************************************
;
; VARIABLES AND CONSTANTS
;
;
;**************************************************************************
;
; RESET ;reset routine

.ORG 0H ;locate routine at 00H
AJMP START ;jump to START
;
;**************************************************************************
;
; INTERRUPTS (not used) ;place interrupt routines at appropriate
;memory locations
.ORG 03H ;external interrupt 0
RETI
.ORG 0BH ;timer 0 interrupt
RETI
.ORG 13H ;external interrupt 1
RETI
.ORG 1BH ;timer 1 interrupt
RETI
.ORG 23H ;serial port interrupt
RETI
.ORG 25H ;locate beginning of rest of program
;
;**************************************************************************
;
INITIALIZE: ;set up control registers
;
MOV TCON,#00H
MOV TMOD,#00H
MOV PSW,#00H
MOV IE,#00H ;disable interrupts
RET
;
;**************************************************************************
;
; Real code starts below. The first two routines are for delays so we
; can slow down the blinking so we can see it. (Without a delay, it
; would blink so fast it would look like it was always on.
;
;**************************************************************************
;
DELAYMS: ;millisecond delay routine
; ;
MOV R7,#00H ;put value of 0 in register R7
LOOPA:
INC R7 ;increase R7 by one (R7 = R7 +1)
MOV A,R7 ;move value in R7 to Accumlator (also known as A)
CJNE A,#0FFH,LOOPA ;compare A to FF hex (256). If not equal go to LOOPA
RET ;return to the point that this routine was called from
;
;**************************************************************************
;
DELAYHS: ;half second delay above millisecond delay
; ;
MOV R6,#0H ;put 0 in register R6 (R6 = 0)
MOV R5,#002H ;put 2 in register R5 (R5 = 2)
LOOPB:
INC R6 ;increase R6 by one (R6 = R6 +1)
ACALL DELAYMS ;call the routine above. It will run and return to here.
MOV A,R6 ;move value in R6 to A
JNZ LOOPB ;if A is not 0, go to LOOPB
DEC R5 ;decrease R5 by one. (R5 = R5 -1)
MOV A,R5 ;move value in R5 to A
JNZ LOOPB ;if A is not 0 then go to LOOPB.
RET
;
;**************************************************************************
;
START: ;main program (on power up, program starts at this point)
ACALL INITIALIZE ;set up control registers
LOOP:
CPL P2.4 ;ComPLement (invert) P2.4 (this makes LED change)
ACALL DELAYHS ;go to above routine that causes a delay
AJMP LOOP ;go to LOOP(always jump back to point labeled LOOP)
.END ;end program


I have read the datasheet and don't think I am missing anything.

Thanks

James Krushlucki

List of 52 messages in thread
TopicAuthorDate
AT89S8252-24PI            01/01/70 00:00      
   Questions            01/01/70 00:00      
      Better answer            01/01/70 00:00      
         The newer they are, the faster they become...            01/01/70 00:00      
            Pictures            01/01/70 00:00      
               try a reset cct            01/01/70 00:00      
                  Reset Generator            01/01/70 00:00      
                     read the reset spec's for your part            01/01/70 00:00      
                        RC-reset circuitry is always critical!            01/01/70 00:00      
                           Doing the math            01/01/70 00:00      
                              a confusion            01/01/70 00:00      
                           I don't like 'em, but it's built into the DS89C4x0            01/01/70 00:00      
                              Power-on problem reported for DS89C440!            01/01/70 00:00      
                                 They're discontinuing the '440 anyway ...            01/01/70 00:00      
                              Trouble with inproper reset circuits            01/01/70 00:00      
                                 Interesting ...            01/01/70 00:00      
                                    This is why....            01/01/70 00:00      
                                       why heresy            01/01/70 00:00      
                              already comented in other thread            01/01/70 00:00      
                                 Still not completely relevant.            01/01/70 00:00      
                                    apples and oranges.            01/01/70 00:00      
                                       Sometimes you feel like a nut. Sometimes you don\'t            01/01/70 00:00      
                                    reset FAQ            01/01/70 00:00      
               Can publish it for you            01/01/70 00:00      
                  Here comes the picture...            01/01/70 00:00      
                     Picture            01/01/70 00:00      
                        Isn't needed at VPP            01/01/70 00:00      
                           Solder side            01/01/70 00:00      
                              Second attempt            01/01/70 00:00      
                                 Ok, last try            01/01/70 00:00      
                                    Hmmm            01/01/70 00:00      
                           Picture of solder side            01/01/70 00:00      
                              a few quick tests            01/01/70 00:00      
                                 bigger cap\'s maybe?            01/01/70 00:00      
                                    Yes Marcia, they do oscillate!            01/01/70 00:00      
                                       Who's Marcia?            01/01/70 00:00      
                                       It's like op-amp's            01/01/70 00:00      
                                 Required equipment            01/01/70 00:00      
                                    it MUST go            01/01/70 00:00      
                                       p0 not a good idea            01/01/70 00:00      
                                          check with a scope AND a pullup, then :-)            01/01/70 00:00      
   Re: questions            01/01/70 00:00      
      programmer            01/01/70 00:00      
   try it with a decent reset IC            01/01/70 00:00      
   Possible solution            01/01/70 00:00      
      Possible solution?            01/01/70 00:00      
      "Increase your org?" What does that mean?            01/01/70 00:00      
         Sorry Russ,            01/01/70 00:00      
            no it has not            01/01/70 00:00      
               what he means is ...            01/01/70 00:00      
                  ORG. $25??            01/01/70 00:00      
                     aren't you fortunate            01/01/70 00:00      

Back to Subject List