Author Topic: P89C51RD2BN ISP code  (Read 4434 times)

Alex

  • Guest
P89C51RD2BN ISP code
« on: May 23, 2005, 10:53:08 am »
In my project I need to include programming code for the MCU in my main program. So I want to write my own code to program the MCU. Iread the AN461 document and tried its control words. But only thing that worked right it's sending 'U' to MCU and getting it back. Other control words didn't work.

can anyone give me a working code that contains control words?
and how do I calculate the checksum?

hope for fast reply

alex

erikm

  • Guest
Re: P89C51RD2BN ISP code
« Reply #1 on: May 23, 2005, 10:55:36 am »
So I want to write my own code to program the MCU.
why? FlashMagic is free and works


can anyone give me a working code that contains control words?
what is a "control word"  AN-461 is about calling sequences.

Erik

Andy Ayre

  • ESAcademy Staff
  • Sr. Member
  • *****
  • Posts: 2160
    • View Profile
    • Embedded Systems Academy, Inc.
    • Email
Re: P89C51RD2BN ISP code
« Reply #2 on: May 23, 2005, 10:55:54 am »
How about calling the command line version of Flash Magic? You can do that from your own program and parse the output very easily.

Embedded Systems Academy, Inc.
support at esacademy dot com

Alex

  • Guest
Re: P89C51RD2BN ISP code
« Reply #3 on: May 23, 2005, 08:31:03 pm »
In some cases the MCU doesn't enter the ISP mode and in some does and I can't understand the difference between the cases. In my understanding if it enters one time so it should enter every time. In my case I have to reset the MCU several times before it enters the ISP mode.

and how do I calculate CheckSum that should come in the end of the sequence?

alex

Andy Ayre

  • ESAcademy Staff
  • Sr. Member
  • *****
  • Posts: 2160
    • View Profile
    • Embedded Systems Academy, Inc.
    • Email
Re: P89C51RD2BN ISP code
« Reply #4 on: May 23, 2005, 08:35:33 pm »
Here is the specification for the Intel Hex File Format:

http://www.precma.it/download/intelhex.pdf

There are lots of reasons why the device cannot reliably enter ISP mode. The baud rate is too high or too low for a given crystal frequency, the hardware conditions for entering ISP mode are not being satisfied fully, etc.

Embedded Systems Academy, Inc.
support at esacademy dot com

Alex

  • Guest
Re: P89C51RD2BN ISP code
« Reply #5 on: May 23, 2005, 08:39:05 pm »
what voltage do i put in Vpp pin?