Flash Magic Forum
September 09, 2010, 07:31:50 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: P89C51RD2BA and MAX232 (wiring RST, /PSEN, TX, RX on the microcontroller)  (Read 1757 times)
dr.d3z
Newbie
*
Posts: 3


View Profile
« on: February 07, 2010, 08:51:07 PM »

Hello guys,

I've found your website a resource of outstanding information that solved lots of my problems. Thanks so much for this awesome website!

So now I've got a problem about my first microcontroller circuit.
I have got a P89C51RD2BA already programmed, so I've built a circuit to run it into ISP mode and use FlashMagicTool to recode - edit - erase it.

After checking some docs on your website, I realized that the microcontroller needs to be forced into ISP mode by setting /PSEN low during the Reset. I was just wondering i you guys have got a circuit or a scheme to automatize this process.
I saw that the FlashMagicTool Manual has a good example about how to automatize this, but it looks like I would need 2 MAX232 as there are 3 RS232 outputs and just 1 TTL input. I am talking about the example circuit, so I was wondering if there's a way to Reset and setting /PSEN low during the reset using a single MAX232, resetting the device using the serial and all the functions supported by FlashMagicTool.
Also, I was wondering if there's any way that the device might be read-write protected even against the hardware ISP running mode.
Any help would be very appreciated guys!

Cheers,
Dr.D3z.
Logged
Andy Ayre
ESAcademy Staff
Sr. Member
*****
Posts: 1630


View Profile WWW Email
« Reply #1 on: February 08, 2010, 05:13:33 PM »

The LPC2xxx ARM7 devices use a similar approach to entering ISP mode and Flash Magic supports it in the same way, namely using DTR and RTS to control reset and the ISP entry pin. Therefore you can look at how Keil Software solved this problem on their eval boards:

http://www.keil.com/mcb2300/mcb2300-schematics.pdf

To lock the device you need to set the security bits. The security bits are only cleared if all the flash memory is erased. I.e. ISP commands are still accepted but are limited in what they can do. Check the NXP user manual for your device for the full details.

regards, Andy
Logged

Embedded Systems Academy, Inc.
support at esacademy dot com
dr.d3z
Newbie
*
Posts: 3


View Profile
« Reply #2 on: February 12, 2010, 05:23:00 AM »

Thanks Andy for your reply.
However I still have got problems starting the P89C51RD2BA into ISP mode.
I have been looking around and I've found different solutions, so I am a bit confused
.
First of all, the RESET, should it be connected to +5 (when the button is pressed), and then go back to GND ( or disconnected ) ?
The PSEN should always be connected to GND (to force ISP mode) during and after the reset?
And.. the 2 pins P2.6 and P2.7 should always be connected to +5 (maybe with a 10k resistor each one) during and after the reset?

Sorry man, but it's fairly new for me this stuff so I am trying to understand...

Also, High or Low .. is the same as saying +5 / GND?

Cheers,
D3z
Logged
dr.d3z
Newbie
*
Posts: 3


View Profile
« Reply #3 on: February 13, 2010, 02:28:16 AM »

Nevermind, I've got it finally working! Smiley
However the 3 security bits are set, so I cannot read/erase the flash ram... do you guys know any way to bypass or erase the security bits?
« Last Edit: February 13, 2010, 02:39:17 AM by dr.d3z » Logged
Andy Ayre
ESAcademy Staff
Sr. Member
*****
Posts: 1630


View Profile WWW Email
« Reply #4 on: February 13, 2010, 04:59:10 AM »

A full device erase should clear the security bits.

Andy
Logged

Embedded Systems Academy, Inc.
support at esacademy dot com
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.10 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!