Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

89S52 problem

Status
Not open for further replies.

ash20

New Member
i have developed my hardware using Atmel 89s52 (for my project), but when i am writing a program for testing it for lcd, the burner software says, "no response from uc".. now what to do?? i am using SPI programming...
please help me. what to do?? how to make my uc detectable??
 
i have bought a spi burner.. its a small hardware.
and i am using flash magic software..
 
Flash magic doesn't support Atmel micro's it supports Phillips and NXP devices. You'll need to get an ATMEL flash programmer.

I remember this topic has been raised before... Your cheapest fix is to buy a Phillips P89C51RC2 or similar

Flash magic devices are listed here. https://www.flashmagictool.com/supporteddevices.html

Sorry to bring you bad news..
 
i am using p89v51rd2. but my flash magic is not detecting it. this is my problem.. how to make it detectable?? it just hangs when i put it to read device signature mode...
 
In your first post you mentioned an Atmel device?

When I program my p89c51rc1 it's done via RS232 ... The circuit required for flash magic..

Remember that a reset button may be required... (I use a switch on the PSEN to force bootloader)
 
oh sorry, actually, i eventually switched to p89v51rd2 and didnt mentioned that. i have the rs 232 cable, and the db9 connector and this max 232 ic. so in all, i am connecting to p89v51rd2 via max232 ic and db9 connector... but problem is when i try to burn the hex file, the flash magic software hangs.. and never goes further. so how can i burn my program??
 
Have you a switch on PSEN to ground (pulled high when not switched) ?

I have to switch the PSEN to ground the press reset... The flash magic software then see's the chip.. You must clear the device (apart from the bootloader) then reprogram..

I can't say I've ever experienced a problem
 
oh yeah.. this is the solution.. :) thnx a lot..
but,

please tell me how to save data in p89v51rd2? i mean i am making attendance recording system and i have to save attendance for 5 classes, 60 students and then display the complete data after all attendance has been recorded.
so how to do that?? how to program this? i am not able to do this..
i have done programming for my 4x4 keypad and lcd. but i am not able to do this..

please give help for coding...
 
I not quite sure what you need to do!! If you need to store some information, you'll need to use non volatile memory... This Phillips chip hasn't any EEprom, but only flash. The problem here is you can only program a block at a time.. not really for memory purposes (I think some have done this, but you'll need to trawl the net ).

You can interface a small I2C eeprom or SPI eeprom.

The LPC series of micros ie.. P89LPC932A1 has eeprom, but it may be easier to use a small external eeprom with your chip.
 
ok so if i use 24C64, then can you tell me how to program it for saving data?
i am not able to do this..
i have done programming for my 4x4 keypad and lcd. but i am not able to do this..
 
Code:
        sda equ P0.0		; set a pin for SDA
        scl equ P0.1		; set a pin for SCL
				; remember to use pullups on these pins
	org	0
	sjmp	start

start:	acall	i2cinit
	mov	R2,#20h		; byte address 
	mov	R1,#55h		; data to test
start2:	acall	writeEEprom	; write 0x55 to eeprom
	acall	delay
	mov	R1,#0		; clear R1
	acall	readEEprom	; read back for loop test
	dec	R2		; new location
	sjmp	start2

writeEEprom:			; R2 = byte address.. R1 = data to write
	acall	startc
	mov	a,#0A0h		; eeprom addess
	acall	Send
	acall	ack
	mov	a,#0		; internal high byte address
	acall	Send
	acall	ack
	mov	a,R2		; internal low byte address
	acall	Send
	acall	ack
	mov	a,R1
	acall	Send
	acall	ack
	acall	stop
	ret

readEEprom:			; R2 = byte address.. R1 = data read
	acall	startc
	mov	a,#0A0h		; eeprom address
	acall	Send
	acall	ack
	mov	a,#0		; high byte
	acall	Send
	acall	ack
	mov	a,R2		; low byte
	acall	Send
	acall	ack
	acall	rstart
	mov	a,#0A1h		; Read command
	acall	Send
	acall	ack
	acall	recv
	mov	R1,a
	acall	nak
	acall	stop
	ret

i2cinit:		;Init I2C ( prepare for I2C transactions )
        setb sda
        setb scl
        ret
rstart:			;ReStart I2C (for reads )
        clr scl
        setb sda
        setb scl
        clr sda
        ret
startc:			;Start I2C bus transaction
        setb scl
        clr sda
        clr scl
        ret
stop:			;Stop I2C bus transaction
        clr scl
        clr sda
        setb scl
        setb sda
        ret
Send:			;Send I2C data
        mov r7,#08
back:   clr scl
        rlc a
        mov sda,c
        setb scl
        djnz r7,back
        clr scl
        setb sda
        ret
ack:			;ACK receive acknowlegde
        clr sda
        setb scl
        clr scl
        setb sda
        ret
nak:			;NAK send acknowledge
        setb sda
        setb scl
        clr scl
        setb scl
        ret
recv:			;Receive I2C data
        mov r7,#08
back2:  clr scl
        setb scl
        mov c,sda
        rlc a
        djnz r7,back2
        clr scl
        setb sda
        ret
 
delay:	mov	R0,#0ffh	; works out about 10mS for write delay
	mov	R3,#0f4h	; a write delay for eeproms IS required
loop:	djnz	R0,loop
	djnz	R3,loop
	ret

	end

I got the I2C routines of the web... The read and write routines seem to work fine
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top