Forums

t89c51cc01 jump to user bootloader

Started by Dan March 2, 2004
Hi all,
	I'm working with an Atmel T89C51CC01 chip and I'm trying to get it to 
jump to a certain location in flash on reset.  The only documentation I 
have for this is a flowchart in the bootloader doc,
http://www.atmel.com/dyn/resources/prod_documents/doc4210.pdf
	Using the flash api, I clear BLJB and set the SBV to the location I 
want to boot to.  I also set FCON to some non-zero value.  This should 
cause execution of the code at the location SBV points to, but instead, 
I end up back in the FM1 Atmel bootloader.  My guess is that I am not 
setting FCON correctly.  Does anybody know the proper sequence to jump 
to the user bootloader?

Thanks,
Dan
> My guess is that I am not >setting FCON correctly.
Looking at the diagram, it looks like you have no choice as to the setting of FCON. If Hardware Condition is true, then FCON gets cleared. If Hardware condition is false and BLJB is clear, then FCON gets set to F0. You want Hardware Condition to be false. So that means having EA clear or PSEN set when /RESET falls. I've never used the chip. I'm just going by the diagram in the document.
Gary Kato wrote:
>>My guess is that I am not >>setting FCON correctly. > > > Looking at the diagram, it looks like you have no choice as to the setting of > FCON. If Hardware Condition is true, then FCON gets cleared. If Hardware > condition is false and BLJB is clear, then FCON gets set to F0. > > You want Hardware Condition to be false. So that means having EA clear or PSEN > set when /RESET falls. > > I've never used the chip. I'm just going by the diagram in the document. >
I agree that it doesn't seem like the test on FCON does anything in this diagram. But, I am certain that PSEN is set on a reset because I am looking at it with a scope. I am also certain that BLJB is clear because when I connect the chip to ATMEL's ISP program, FLIP, it reads BLJB and tells me so. So I am very unclear on what I am doing wrong. Perhaps the User Bootloader code has to have some specific instructions in it? Right now I am just using a test code which flips a pin. Dan
Where is the bootcode you're trying to go to? I'm seeing documents with two
different SBV values that get tested to see if the user or Atmel bootloaders
are to be run. The doc you linked to compares to F8 while an errata sheet says
FC.

It also looks like the 1.2 bootloader looks at the BSB bit, although that
determined if the application or boot process get run.

Gary Kato wrote:
> Where is the bootcode you're trying to go to? I'm seeing documents with two > different SBV values that get tested to see if the user or Atmel bootloaders > are to be run. The doc you linked to compares to F8 while an errata sheet says > FC. > > It also looks like the 1.2 bootloader looks at the BSB bit, although that > determined if the application or boot process get run. >
I'm setting SBV to 0x40, so it's less than F8 and FC. I just noticed that the bootloader errata has a different flowchart. Thanks for bringing that to my attention. Dan