Author Topic: 669iaplib  (Read 10400 times)

Ingo

  • Jr. Member
  • **
  • Posts: 17
    • View Profile
669iaplib
« on: July 08, 2004, 08:35:57 am »
Hi
I want to use the 669iaplib, but not as HUGE ROM model.
Is there anything else to change, or just ERET to RET?

Andy Ayre

  • ESAcademy Staff
  • Sr. Member
  • *****
  • Posts: 2160
    • View Profile
    • Embedded Systems Academy, Inc.
    • Email
Re: 669iaplib
« Reply #1 on: July 08, 2004, 09:28:06 am »
You might have to change the segment declarations too. Try it and see.

Embedded Systems Academy, Inc.
support at esacademy dot com

Ingo

  • Jr. Member
  • **
  • Posts: 17
    • View Profile
Re: 669iaplib
« Reply #2 on: July 09, 2004, 01:03:29 am »
Ok

Change
?PR?iap_read_manufacturer_id?P669IAPLIB      SEGMENT ECODE INSEG
.
.
To
?PR?iap_read_manufacturer_id?P669IAPLIB      SEGMENT CODE INSEG
.
.

Is that all ?

Ingo

  • Jr. Member
  • **
  • Posts: 17
    • View Profile
Re: 669iaplib
« Reply #3 on: July 09, 2004, 01:46:35 am »

I do have some problem with the function "erase_block".
"
   put_message("669 IAP Test\r\n");   
  sprintf(Modemstring,"Manufacturer ID = %2.2bX\r\n", iap_read_manufacturer_id());
   put_message(Modemstring);   
  sprintf(Modemstring,"Device ID 1 = %2.2bX\r\n", iap_read_device_id(1));
   put_message(Modemstring);   
  sprintf(Modemstring,"Device ID 2 = %2.2bX\r\n", iap_read_device_id(2));
   put_message(Modemstring);   
  sprintf(Modemstring,"Security bits = %2.2bX\r\n", iap_read_security_bits());
   put_message(Modemstring);   

  sprintf(Modemstring,"0x00d000 contains %2.2bX\r\n", iap_read_data_byte(0xd000, 0x00));
   put_message(Modemstring);   
 
  if (!iap_program_data_byte(0x55, 0xd000, 0x00))
    sprintf(Modemstring,"0x00d000 programmed to 0x55 ok\r\n");
  else
    sprintf(Modemstring,"Error programming 0x00d000 to 0x55\r\n");
   put_message(Modemstring);   

  sprintf(Modemstring,"0x00d000 contains %2.2bX\r\n", iap_read_data_byte(0xd000, 0x00));
   put_message(Modemstring);   

  if (!iap_erase_block(BLOCK_6))
    sprintf(Modemstring,"Block 6 erased\r\n");
  else
    sprintf(Modemstring,"Error erasing block 6\r\n");
   put_message(Modemstring);   

"
The code runs to   "if (!iap_erase_block(BLOCK_6))" and then the processor reset.
And I have no watchdog running. so what is wrong any idea?

I have all the security bits to 0.
By the way, where can I get information about the purpose for each security bit?

Andy Ayre

  • ESAcademy Staff
  • Sr. Member
  • *****
  • Posts: 2160
    • View Profile
    • Embedded Systems Academy, Inc.
    • Email
Re: 669iaplib
« Reply #4 on: July 09, 2004, 09:10:14 am »
Does your test program work in ROM HUGE mode with the original IAP lib?

Embedded Systems Academy, Inc.
support at esacademy dot com

Ingo

  • Jr. Member
  • **
  • Posts: 17
    • View Profile
Re: 669iaplib
« Reply #5 on: July 12, 2004, 12:24:38 am »
Yes
And it also run as Large 64K program with my changes

Andy Ayre

  • ESAcademy Staff
  • Sr. Member
  • *****
  • Posts: 2160
    • View Profile
    • Embedded Systems Academy, Inc.
    • Email
Re: 669iaplib
« Reply #6 on: July 12, 2004, 10:06:59 am »
Well if it works in ROM HUGE and it work as LARGE then what is the problem?

Embedded Systems Academy, Inc.
support at esacademy dot com

Ingo

  • Jr. Member
  • **
  • Posts: 17
    • View Profile
Re: 669iaplib
« Reply #7 on: July 13, 2004, 12:45:28 am »
Sorry
The testprogram "k669IAPLIBExample" runs in ROM HUGE and LARGE.
But in my application the function "iap_erase_block(x) allways make the
processor to reset/start over from PC 0000.

Is there any change to get a copy of the soft that's behind the IAP?

Couldt it be a STACK problem? intern/extern RAM?

Ingo

  • Jr. Member
  • **
  • Posts: 17
    • View Profile
Re: 669iaplib
« Reply #8 on: July 13, 2004, 02:31:03 am »
I found this on philps forum
"Posted: Wed Dec 17, 2003 10:45 pm    Post subject:    

--------------------------------------------------------------------------------
 
I've had a similar problem with IAP when going to the new version of P89C51RC chips. I could not write new code unless the stack pointer was not set to be between 4Ah and 51h. Philips has not been able to verify this as a problem or tell me what i'm doing wrong.
"
I changed my program so that the stack start at 0x5B, and now it works.

Andy Ayre

  • ESAcademy Staff
  • Sr. Member
  • *****
  • Posts: 2160
    • View Profile
    • Embedded Systems Academy, Inc.
    • Email
Re: 669iaplib
« Reply #9 on: July 13, 2004, 08:38:21 am »
Ok, so the test program with the library runs ok. What happens if you add iap_erase_block to that? Does it still work ok or does it do the same thing?

There is no source code available for the bootloader, and I'm not aware of any stack problems on the 669.

Embedded Systems Academy, Inc.
support at esacademy dot com

Tom

  • Guest
Re: 669iaplib
« Reply #10 on: July 13, 2004, 04:27:27 pm »
First I moved myself from P89C668 ISP to this thread.
And next is HORROR

I wrote the function below for crossing into ISP mode (calls to "rx2iaplib.a51" library).
After execution the result was locking up the processor ISP.
 
void Boot(void)
{
EA = 0;
iap_init(12);
iap_erase_boot_vector_status_byte();
iap_program_boot_vector(0xFC);
iap_program_status_byte(0xFF);
WDTRST = 0x1E;
WDTRST = 0xE1;
while(1);
}

I read carefully once again the P89C669 user manual and :-(
One part of the parameters is not passed in to the IAP routine via DPH and DPL registers (as it is described in AN461).

!!!!! --- The P89C669 it use EPH and EPL. --- !!!!!

To crown my misery I have parallel programmer but not necessary adapter. And adapter is very expensive just to recover one processor.

Perhaps somebody knows how wired is PA44-48U adapter (PLCC44 to DIL 40) for ChipMax from EE Tools? Simple cross wiring (pin name to pin name) is not functional ... I tested :(

Andy Ayre

  • ESAcademy Staff
  • Sr. Member
  • *****
  • Posts: 2160
    • View Profile
    • Embedded Systems Academy, Inc.
    • Email
Re: 669iaplib
« Reply #11 on: July 13, 2004, 04:33:22 pm »
Tom,

I'm sorry to hear that. Why were you using the Rx2 library when we have a dedicated 669 library on our site as well?

AN461 doesn't 100% apply to the 669.

Embedded Systems Academy, Inc.
support at esacademy dot com

Ingo

  • Jr. Member
  • **
  • Posts: 17
    • View Profile
Re: 669iaplib
« Reply #12 on: July 14, 2004, 12:34:22 am »
The testprogram is from you, and it's include the function
"iap_erase_block" .

The testprogram have the stack point at 0x21 and it works.

After I changed the stack to point at 0x5b insteed of 0x49 in my program, it works.

So there must be some stack problems with 669.

/Ingo

Todd

  • Guest
Re: 669iaplib
« Reply #13 on: July 16, 2004, 01:14:29 pm »
I find this to be very similar to my problem with the P89c51RB2BA. Here is a link to my problem and what I think the cause is: http://forums.semiconductors.philips.com/forums/viewtopic.php?t=3993

Todd Stanchfield

Todd

  • Guest
Re: 669iaplib
« Reply #14 on: July 16, 2004, 01:19:57 pm »
If the link does not seem to directly link to the topic, read the topic "IAP - Erase Block Hang-Up Problem"

http://forums.semiconductors.philips.com/forums/viewtopic.php?t=3993

Todd Stanchfield