Sign in

username:

password:



Not a member?

Search LPC900_users



Search tips

Subscribe to LPC900_users



Ads

Discussion Groups

Discussion Groups | LPC900 | Difference of 935 and 938 timers

Find help, specifications and source code for the LPC900. The LPC900 challenges Microchip and AVR based on the worlds most popular 8-bit architecture the 80C51. With a 2-clock core the LPC900 series is a high performance, very flexible and low cost 8-bit microcontroller family. Designers using or interested in these devices are encouraged to share their know-how and ask questions.

Difference of 935 and 938 timers - yen0yuki - Jan 19 21:33:00 2006

Dear all,

I want to use Timer0 of LPC938.
So I try simulation by uVision3.
When I selected [option] - [Device]tag "LPC938",
I want it to move at about 100us cycle but it moves at about 180us.
When I selected "LPC935",
It moves at about 100us.

Why does this happen? I wrote C-code:
----------------------------------------
#define TH0_VAL 0xFE;
#define TL0_VAL 0x96;

int main(void)
{

f_init();

EA = 1;

while(1)
{
if(Int_flg)
{
// @100us
Int_flg = 0;

}

}

}

void f_init(void)
{
DIVM = 0;

TMOD &= 0xF0;
TMOD |= 0x01;
TAMOD &= 0xFE;

TH0 = TH0_VAL;
TL0 = TL0_VAL;

IP0 &= 0xFD;
IP0H &= 0xFD;

ET0 = 1;

TR0 = 1;
} /* TIMER 0 interrupt */

void KsInt(void) interrupt 1 using 1
{
Int_flg = 1;

TH0 = TH0_VAL;
TL0 = TL0_VAL; }




(You need to be a member of LPC900_users -- send a blank email to LPC900_users-subscribe@yahoogroups.com )


Re: Difference of 935 and 938 timers - philips_apps - Jan 20 13:19:00 2006

Hi,

the timers are identical on both microcontrollers. There is a chance
that you slected 12 MHz external clock for one micro and the
internal RC oscillator running at 7.373 MHz for the other micro.
Although it is not exactly the difference you describe 100 versus
180, it comes close.

Robert

--- In lpc900_users@lpc9..., "yen0yuki" <tadayuki@r...>
wrote:
>
> Dear all,
>
> I want to use Timer0 of LPC938.
> So I try simulation by uVision3.
> When I selected [option] - [Device]tag "LPC938",
> I want it to move at about 100us cycle but it moves at about 180us.
> When I selected "LPC935",
> It moves at about 100us.
>
> Why does this happen? > I wrote C-code:
> ----------------------------------------
> #define TH0_VAL 0xFE;
> #define TL0_VAL 0x96;
>
> int main(void)
> {
>
> f_init();
>
> EA = 1;
>
> while(1)
> {
> if(Int_flg)
> {
> // @100us
> Int_flg = 0;
>
> }
>
> }
>
> }
>
> void f_init(void)
> {
> DIVM = 0;
>
> TMOD &= 0xF0;
> TMOD |= 0x01;
> TAMOD &= 0xFE;
>
> TH0 = TH0_VAL;
> TL0 = TL0_VAL;
>
> IP0 &= 0xFD;
> IP0H &= 0xFD;
>
> ET0 = 1;
>
> TR0 = 1;
> } > /* TIMER 0 interrupt */
>
> void KsInt(void) interrupt 1 using 1
> {
> Int_flg = 1;
>
> TH0 = TH0_VAL;
> TL0 = TL0_VAL; > }




(You need to be a member of LPC900_users -- send a blank email to LPC900_users-subscribe@yahoogroups.com )

Re: Difference of 935 and 938 timers - yen0yuki - Jan 23 2:20:00 2006

Dear Robert,

Thanks you for your answer.

> There is a chance
> that you slected 12 MHz external clock for one micro and the
> internal RC oscillator running at 7.373 MHz for the other micro.

Either microcomputer is the same setting that it is selected internal
RC oscillator(7.373MHz).
It is only a selection of the device that differs.





(You need to be a member of LPC900_users -- send a blank email to LPC900_users-subscribe@yahoogroups.com )