EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

RTI

Started by RUDY CEPEDA April 23, 2006
Hi all

I'm trying to use the Real Time Interrupt of the MC68HC912B32 for generate a sample time.

The problem is that the MCU runs only with the P&E multilink conected, using or not the HIWAVE. I can not understand where is the problem.

There is the code I used to configure the RTI

void inicia_RTI(void){
/*******************************************************
* Funci de inicializaci de la funci RTI (Real *
* Time Interrupt) del Mulo de Generacion de Reloj. *
* Produce una interrupci cada 32.768ms para obtener *
* una frecuencia de muestreo de 30.51Hz *
*******************************************************/
//Bits de selecci del periodo de interrupci
RTR0=1;
RTR1=0;
RTR2=1;
//Activar Interrupci Periica
RTIE=1;
}

Any tip?

Thanks In advance

"Son las palabras, por supuesto, la droga mas poderosa usada por la mente humana"
Rudy Cepeda Gez
Ingeniero Electrico (C) - UIS



---------------------------------

LLama Gratis a cualquier PC del Mundo.
Llamadas a fijos y miles desde 1 ctimo por minuto.
http://es.voice.yahoo.com





Old HC12 parts (912B32, 912D60(A),..) have COP enabled after reset in
normal modes of operation. Debugging via BDM port usually means special
singlechip mode. That's why your code may work with multilink and keep
resetting without multilink connected. Either feed COP watchdog with 0xaa's
and 0x55's or disable it ASAP after reset.

Edwrad
----- Original Message -----
From: "RUDY CEPEDA"
To: <6...>
Sent: Sunday, April 23, 2006 9:13 PM
Subject: [68HC12] RTI
> Hi all
>
> I'm trying to use the Real Time Interrupt of the MC68HC912B32 for
> generate a sample time.
>
> The problem is that the MCU runs only with the P&E multilink conected,
> using or not the HIWAVE. I can not understand where is the problem.
>
> There is the code I used to configure the RTI
>
> void inicia_RTI(void){
> /*******************************************************
> * Funci de inicializaci de la funci RTI (Real *
> * Time Interrupt) del Mulo de Generacion de Reloj. *
> * Produce una interrupci cada 32.768ms para obtener *
> * una frecuencia de muestreo de 30.51Hz *
> *******************************************************/
> //Bits de selecci del periodo de interrupci
> RTR0=1;
> RTR1=0;
> RTR2=1;
> //Activar Interrupci Periica
> RTIE=1;
> }
>
> Any tip?
>
> Thanks In advance
>
> "Son las palabras, por supuesto, la droga mas poderosa usada por la mente
> humana"
> Rudy Cepeda Gez
> Ingeniero Electrico (C) - UIS
>
> ---------------------------------
>
> LLama Gratis a cualquier PC del Mundo.
> Llamadas a fijos y miles desde 1 ctimo por minuto.
> http://es.voice.yahoo.com
>
>
>
Thanks Edward, but it's only going wrong with this program. I have already disabled the COP, the MCU works o.k. with another programs.

Edward Karpicz escribi Old HC12 parts (912B32, 912D60(A),..) have COP enabled after reset in
normal modes of operation. Debugging via BDM port usually means special
singlechip mode. That's why your code may work with multilink and keep
resetting without multilink connected. Either feed COP watchdog with 0xaa's
and 0x55's or disable it ASAP after reset.

Edwrad
----- Original Message -----
From: "RUDY CEPEDA"
To: <6...>
Sent: Sunday, April 23, 2006 9:13 PM
Subject: [68HC12] RTI
> Hi all
>
> I'm trying to use the Real Time Interrupt of the MC68HC912B32 for
> generate a sample time.
>
> The problem is that the MCU runs only with the P&E multilink conected,
> using or not the HIWAVE. I can not understand where is the problem.
>
> There is the code I used to configure the RTI
>
> void inicia_RTI(void){
> /*******************************************************
> * Funci de inicializaci de la funci RTI (Real *
> * Time Interrupt) del Mulo de Generacion de Reloj. *
> * Produce una interrupci cada 32.768ms para obtener *
> * una frecuencia de muestreo de 30.51Hz *
> *******************************************************/
> //Bits de selecci del periodo de interrupci
> RTR0=1;
> RTR1=0;
> RTR2=1;
> //Activar Interrupci Periica
> RTIE=1;
> }
>
> Any tip?
>
> Thanks In advance
>
> "Son las palabras, por supuesto, la droga mas poderosa usada por la mente
> humana"
> Rudy Cepeda Gez
> Ingeniero Electrico (C) - UIS
>
> ---------------------------------
>
> LLama Gratis a cualquier PC del Mundo.
> Llamadas a fijos y miles desde 1 ctimo por minuto.
> http://es.voice.yahoo.com
>
>
>
COP rate select bits are write once bits. If you try to set any of bit3-bit7
in COPCTL register prior to clearing CR2-CR0 bits then COP still will be
enabled.
Another tip. Maybe you don't have pull up resistor at /reset pin or brown
out reset chip isn't working? Attaching multilink could make you thinking
that your reset circuit is OK. Also what if you don't have pull up at BKGD?
Part would reset into special mode..

Edward

----- Original Message -----
From: "RUDY CEPEDA"
To: <6...>
Sent: Sunday, April 23, 2006 10:10 PM
Subject: Re: [68HC12] RTI
> Thanks Edward, but it's only going wrong with this program. I have already
> disabled the COP, the MCU works o.k. with another programs.
>
> Edward Karpicz escribi Old HC12 parts (912B32,
> 912D60(A),..) have COP enabled after reset in
> normal modes of operation. Debugging via BDM port usually means special
> singlechip mode. That's why your code may work with multilink and keep
> resetting without multilink connected. Either feed COP watchdog with
> 0xaa's
> and 0x55's or disable it ASAP after reset.
>
> Edwrad
> ----- Original Message -----
> From: "RUDY CEPEDA"
> To: <6...>
> Sent: Sunday, April 23, 2006 9:13 PM
> Subject: [68HC12] RTI
>> Hi all
>>
>> I'm trying to use the Real Time Interrupt of the MC68HC912B32 for
>> generate a sample time.
>>
>> The problem is that the MCU runs only with the P&E multilink conected,
>> using or not the HIWAVE. I can not understand where is the problem.
>>
>> There is the code I used to configure the RTI
>>
>> void inicia_RTI(void){
>> /*******************************************************
>> * Funci de inicializaci de la funci RTI (Real *
>> * Time Interrupt) del Mulo de Generacion de Reloj. *
>> * Produce una interrupci cada 32.768ms para obtener *
>> * una frecuencia de muestreo de 30.51Hz *
>> *******************************************************/
>> //Bits de selecci del periodo de interrupci
>> RTR0=1;
>> RTR1=0;
>> RTR2=1;
>> //Activar Interrupci Periica
>> RTIE=1;
>> }
>>
>> Any tip?
>>
>> Thanks In advance
>>
>> "Son las palabras, por supuesto, la droga mas poderosa usada por la mente
>> humana"
>> Rudy Cepeda Gez
>> Ingeniero Electrico (C) - UIS
>>
>> ---------------------------------
>>
>> LLama Gratis a cualquier PC del Mundo.
>> Llamadas a fijos y miles desde 1 ctimo por minuto.
>> http://es.voice.yahoo.com
>>
>>
>>
Hi Edward, thanks again, but I've already worked with another porograms in the same board and all of them have run alright without the multilink.

The problem is only in the program wich have the RTI enabled.

In fact, the program runs with the multilink connected although both hiwave and code warrior aren't opened, but it crashes when i disconnect it.

Any other suggest?

Edward Karpicz escribi
COP rate select bits are write once bits. If you try to set any of bit3-bit7
in COPCTL register prior to clearing CR2-CR0 bits then COP still will be
enabled.
Another tip. Maybe you don't have pull up resistor at /reset pin or brown
out reset chip isn't working? Attaching multilink could make you thinking
that your reset circuit is OK. Also what if you don't have pull up at BKGD?
Part would reset into special mode..

Edward

> ----- Original Message -----
> From: "RUDY CEPEDA"
> To: <6...>
> Sent: Sunday, April 23, 2006 9:13 PM
> Subject: [68HC12] RTI
>> Hi all
>>
>> I'm trying to use the Real Time Interrupt of the MC68HC912B32 for
>> generate a sample time.
>>
>> The problem is that the MCU runs only with the P&E multilink conected,
>> using or not the HIWAVE. I can not understand where is the problem.
>>
>> There is the code I used to configure the RTI
>>
>> void inicia_RTI(void){
>> /*******************************************************
>> * Funci de inicializaci de la funci RTI (Real *
>> * Time Interrupt) del Mulo de Generacion de Reloj. *
>> * Produce una interrupci cada 32.768ms para obtener *
>> * una frecuencia de muestreo de 30.51Hz *
>> *******************************************************/
>> //Bits de selecci del periodo de interrupci
>> RTR0=1;
>> RTR1=0;
>> RTR2=1;
>> //Activar Interrupci Periica
>> RTIE=1;
>> }
>>
>> Any tip?
>>
>> Thanks In advance
>>
>> "Son las palabras, por supuesto, la droga mas poderosa usada por la mente
>> humana"
>> Rudy Cepeda Gez
>> Ingeniero Electrico (C) - UIS
>>
>> ---------------------------------
>>
>> LLama Gratis a cualquier PC del Mundo.
>> Llamadas a fijos y miles desde 1 ctimo por minuto.
>> http://es.voice.yahoo.com
>>
>>
>>

The 2024 Embedded Online Conference