Work with 2 P89LPC935

Started by aldrin, December 12, 2006, 08:01:04 AM

Previous topic - Next topic

aldrin

Hello,

I have a problem. I use one Serial of my computer for programing two P89LPC935. Then, I have a board that create the signal of RST (the three pulses), and in this board i have a jumper for transmiting the RST to one or other device.

I wish program one, and after the other. But I can't do this. Always I program both, because both are in ISP mode, but i transmit my RST only a one device, then i don't understand because both are in ISP mode. I think that It is cause of Break Detect, but i'm not sure.

In the code i have put the no_touch935() in this form:

   if (received_char == 'F')
      {
      uart_transmit('F');
      no_touch935();
      }

and the uart_init();

void uart_init(unsigned char address,unsigned char mask)
{
  // configure UART
  // clear SMOD0
  PCON &= ~0x40;
  SCON = 0xB0;
  // set or clear SMOD1
  PCON &= 0x7f;
  PCON |= (0 << 8);
  SSTAT = 0xF1;

  // configure address and mask
  SADDR = address;
  SADEN = mask;

  // enable break detect
  AUXR1 |= 0x40;

  // configure baud rate generator
  BRGCON = 0x00;
  BRGR0 = 0xF0;
  BRGR1 = 0x02;
  BRGCON = 0x03;

  // TxD = push-pull, RxD = input
  P1M1 &= ~0x01;
  P1M2 |= 0x01;
  P1M1 |= 0x02;
  P1M2 &= ~0x02;

  // initially not busy
  mtxbusy = 0;

  // enable uart receive interrupt
  ESR = 1;
  // enable uart transmit interrupt
  EST = 1;

} // uart_init


Then now I am in a point that i don't know how continue for the devices work correct.

My procedure is the following one:




I have lost more P89LPC935, and i'm tired of changing one and one more. Thanks.

aldrin

Sorry,

My procedure is the following:
1.- First I switch on the power source
2.- I put the jumper of RST in the correct position for one or other device that i wish program
3.- I use Flash Magic for programming

I don't understand because if I don't push the bottom the device go into the ISP mode.

Then,

How can i discriminate in the programming one or other device with RST signal? and How can i do that only one device go into the ISP mode and the other no?

How do i go into the ISP mode with this conditions?

How can i use the notouch935(); function?


erikm

I have a board that create the signal of RST (the three pulses), and in this board i have a jumper for transmiting the RST to one or other device.

In the code i have put the no_touch935() in this form:


you are mixing the reset initialize and the NoTouch initialize.  You can, of course use both, should you so desire, but, in that case, make the "NoTouch activator" different.

I do not quite understand I use one Serial of my computer for programing two P89LPC935 do they share the connector on your uC board?

You do know that 'factory fresh' chips arrive in ISP mode?

Erik
erik

aldrin

Then, What do you recomend me for going into ISP mode with this uC?
How can i do the different activator?

My design works with 31 P89LPc935, one is the master and the others are the slaves, the master is connected with slaves with I2C. Master and Slaves have differents codes, then i need program differents software. I have connected the 31 uC to the same Serial Line (RS232).

So, I need that when i'm programming the Master the slaves aren't in ISP mode, and viceversa. My problem is that always when I programming my devices with the code within UART interrut set, when i intent program another time the uC, the uC don't respond.

Then, What is the procedure for that i don't have this problems? I wish program the device one and more times. What must I do?

Must I remove the notouch935 function, o remove the RST signal?

Thanks.

erikm

I have connected the 31 uC to the same Serial Line (RS232).
first, how close are these devices, running IIC for any distance is very 'dangerous'
second if all are sharing the same MAX232  equivalent, the how far apply again.

now, if they are close and you can program them individually the first time only then replace your NoTouch activate 'F' with "NODE1", "NODE2" ... for the slaves then NoTouch will only open one device. You need to program them once (no reset required - new chips are in ISP mode) to get NoTouch in.

What I would do, however, would be to get rid of the parallelled serial and program the slaves vis IIC using the ICP code.

Erik
erik

aldrin

Ok, but, Must i have the break detect enable, or not?, I think that Break detect affects my uC and alwais go to ISP mode. Is necessary or not?

With No_touch, Can I program the same device more than once?, once that i have notouch in my code, Can I discriminate the uC?

for use no_touch, Must I use hyperterminal of Windows, or the Terminal of flashMagic, no?

Thanks for all, i think that finally this design will work correctly If god wants.

didac

I have a problem more or less than you.

But i have another dude more.

After that I call the notouch(), Must i do a reset of the device?, or is sufficient only execut the funciont (notouch)

What do you think?

erikm

Ok, but, Must i have the break detect enable, or not?,
With NoTouch, you do not need the break detect; however Id recommend to install the 'safety' descriibed in "the backdoor"
Using NoTouch and "the backdoor" you will need to remove the chip or take other means only in one case: if power fails during programming.

With No_touch, Can I program the same device more than once?
yes, but it is essential that you get NoTouch in on the first programming of a new chip

for use no_touch, Must I use hyperterminal of Windows, or the Terminal of flashMagic, no?
you can probably use any of the above, I believe, but the only verification of NoTouch known to me is with using FlashMagic

Erik

PS it is NoTouch, not no_touch
erik

erikm

After that I call the notouch(), Must i do a reset of the device?
No, if you do that you will not be able to program.  However, in some cases you may need to reset the chip when FlashMagic is done

Erik
erik