Main Menu
Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - tanuja

#1
LPC9xx/LPC9xxx / How to configure timers in P89LPC932
February 23, 2006, 09:54:06 PM
Hi everyone,

How to configure the timer0 or timer1 in 16 bit timer mode using 12Mhz crystal oscillator for P89LPC932.
If i want to generate delay of 1sec, how it can be done using timer in 16 bit timer mode.
I tried with code generator, but cannot understand it, as i cannot select the timer mode there.
Please guide me.

Thanks
#2
Dear all,

I am struck with the problem in using P89LPC932.
I am using P89LPC932B for my project which is Revision G.
And ISP programming using Break Detect method.
Without knowing about the ISP code to include in program, i have lost 1 chip.I cannot reprogram it.

But later i developed my program which supports break detect as following
These functions are called in my main program.

void init(void)
{
P1M1 = 0x00; //quasi-bi
P1M2 = 0x00;
P2M1 = 0x00;
P2M2 = 0x00;
}

void brkrst_init()    //This function allows ISP entry through the UART break detect
{
AUXR1 |= 0x40;           //enable reset on break detect
PCON &= ~0x40;
SCON = 0x50;             //select the BRG as UART baud rate source
SSTAT = 0x00;
BRGCON = 0x00;                    
BRGR0 = 0xD2;            //9600 BAUD at 12MHz
BRGR1 = 0x04;
BRGCON = 0x03;           //enable BRG
}

I did reprogramming 5-6 times. It was working for me.

Later in another project code i included the following code for init() and void brkrst_init()  was same as above.  

void init(void)            
{
P1M1 = 0x0C;      ports push pull except RX (bi-directional) and SCL and SDA (Open drain)
P1M2 = 0xFD;      
P2M1 = 0x00;         // all ports push pull
P2M2 = 0xFF;
P0M1 = 0x00;         // all ports push pull
P0M2 = 0xFF;
   
PORT00 = 1;            //SENS_START_UNBUF is active LOW (presently inactive)
I2SCLL = 0x64;         // Equal high and Low states for SCL
I2SCLH = 0x64;
CRSEL = 0;
I2EN = 1;            // Initializing I2CON to enable I2C function

}  

After downloading this program i cannot reprogram it again. I did not change any configuration in flash magic. I followed the same procedure as before.

For the second  case in init() ,only the port configuration is different.
So is the port configuration also matters for break detect method of ISP.
What is the correct method for port configuration.

If anything wrong in my code please correct me.

Any suggestions are welcome.

Waiting for your reply.

Thank u in advance.