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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
06/02/06 11:19
Read: times


 
#117590 - Try this
Responding to: ???'s previous message
Before you give up, assemble this progrm and run it. It should write an incrementing counter to each SRAM location, then reads them back and checks for errors twice. You can see success/failure on Port 1.0 and Port 1.1:

;+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

	SP		equ	81h			;stack pointer
	DPL		equ	82h			;low byte of data pointer
	DPH		equ	83h			;high byte of data pointer
	DPS		equ	86h			;data pointer select sfr
	PMR		equ	0C4h			;power management sfr

	SUCCESS		equ	90h			;P1.0
	FAIL		equ	91h			;P1.1

	TESTER		equ	30h
	TEST_COUNT	equ	31h
	
;+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

			org	0000h

			ajmp	START
							
			org	0080h

;---------------------------------------------------------------
START:

			mov	SP,#7Fh
			orl	DPS,#00010000b		;auto-increment DPTR
			orl	PMR,#00000001b	        ;internal 1kB sram enabled

			setb	SUCCESS			;LEDs off
			setb	FAIL

			clr	A
			mov	DPTR,#0000h

WRITE_LOOP:		movx	@DPTR,A			;write SRAM
			inc	A
			mov	R0,DPH
			cjne	R0,#04h,WRITE_LOOP	;last SRAM address = 03FFh

			mov	TEST_COUNT,#00d

TEST_LOOP:		mov	DPTR,#0000h
			mov	TESTER,#00h

READ_LOOP:		movx	A,@DPTR			;read SRAM
			cjne	A,TESTER,ERROR		;tester holds what should be in SRAM
			inc	TESTER
			mov	R0,DPH
			cjne	R0,#04h,READ_LOOP	;last SRAM address = 03FFh

			inc	TEST_COUNT
			mov	A,TEST_COUNT
			cjne	A,#02d,TEST_LOOP	;test twice

			clr	SUCCESS			;no errors, success LED on
			sjmp	$

ERROR:			clr	FAIL			;fail LED on
			sjmp	$

;***************************************************************
			end


List of 67 messages in thread
TopicAuthorDate
DS89C420 internal SRAM Access question            01/01/70 00:00      
   Timed access            01/01/70 00:00      
      Re: Timed access            01/01/70 00:00      
         Lacking ?            01/01/70 00:00      
            Re: Lacking            01/01/70 00:00      
   dunno            01/01/70 00:00      
      Re: dunno            01/01/70 00:00      
         lots of features to track            01/01/70 00:00      
   Example Code            01/01/70 00:00      
      Dallas SRAM Access            01/01/70 00:00      
   Update / Further Puzzle            01/01/70 00:00      
      False Alarm            01/01/70 00:00      
         A bug, maybe?            01/01/70 00:00      
            Isn't that CPU EOL (or not for new des?)            01/01/70 00:00      
               Yes, it's been replaced but he has it.            01/01/70 00:00      
                  Not Quite EOL but thats next ...            01/01/70 00:00      
                     Could be a disappointment            01/01/70 00:00      
                  how are you going to know if the problem            01/01/70 00:00      
                  Damned with faint praise!            01/01/70 00:00      
                     Clearly it's not for production            01/01/70 00:00      
                        Is there a difference between IAP & ISP?            01/01/70 00:00      
                           what I understand is            01/01/70 00:00      
                              DS89C4x0 IAP/ISP explained            01/01/70 00:00      
                           Final Update            01/01/70 00:00      
                              Try this            01/01/70 00:00      
                                 Re: Try this            01/01/70 00:00      
                                    It may be time for a different specimen            01/01/70 00:00      
                                       Re: new specimen            01/01/70 00:00      
                                          huh?            01/01/70 00:00      
                                             not enough benefit in replacing            01/01/70 00:00      
                                          I've been at this a LONG time ...            01/01/70 00:00      
                                    what does it return            01/01/70 00:00      
                                       returns 0x00            01/01/70 00:00      
                                          probably, but why?            01/01/70 00:00      
                                          I doubt you have to connect 'em            01/01/70 00:00      
                                              do not know what ISTR is            01/01/70 00:00      
                                                what it means            01/01/70 00:00      
                                                me either            01/01/70 00:00      
                                                   before you "move on"            01/01/70 00:00      
                                          oscillscope             01/01/70 00:00      
                                             it's not clear how a 'scope will help            01/01/70 00:00      
                                                Well a 'scope would ...            01/01/70 00:00      
                                                   exactly ... so why not have another look            01/01/70 00:00      
                                                      code?            01/01/70 00:00      
                                                         What about SFR definitions?            01/01/70 00:00      
                                                            SFR Def            01/01/70 00:00      
                                                            SFR was defined            01/01/70 00:00      
                                                               bad idea            01/01/70 00:00      
                                                                  Yep, it leads to confusion!            01/01/70 00:00      
                                    but...            01/01/70 00:00      
                                       confusion            01/01/70 00:00      
                                          That was what I wondered, too.            01/01/70 00:00      
                                             So ... What about it?            01/01/70 00:00      
                                             Clear a few things up            01/01/70 00:00      
                        wrong way around            01/01/70 00:00      
                     Most the time..            01/01/70 00:00      
                        That's undoubtedly the case.            01/01/70 00:00      
   Matthew, I am curious about something            01/01/70 00:00      
      Answer as best I can            01/01/70 00:00      
         It's still not clear ...            01/01/70 00:00      
            hmmm try some more            01/01/70 00:00      
               I don't think I'd try that ...            01/01/70 00:00      
                  Re:            01/01/70 00:00      
                     It's not rude ...            01/01/70 00:00      
                        Now ... here's what I did ...            01/01/70 00:00      
               test.asm once more            01/01/70 00:00      
                  Some more questions            01/01/70 00:00      

Back to Subject List