DSPRelated.com
Forums

Fw: Clock Calibration / Reading Flash - ALLOW ZIP

Started by Mariano Filippa January 30, 2004
Here is how I did it. If you don't have an oscilloscope, try to get one.
Without one, it would be impossible.

Use the project I've included. Take a look at main. There are two tests: one
sets a PWM output. You should be able to measure the frequency and adjust
the oscillator until the frequency is ok.

The second test just sends characters at 9600bps through the SCI port. You
should be able to verify the period with a scope between the start and stop
bit.

Everything is explained in the main code "dsp_main.c". Should compile and
run right away. Don't worry about the extra code and functions. They will be
deadstripped. Before running, read the main routine for instructions.

Some notes:
- If you don't have an oscilloscope, don't bother trying. Get one, borrow
one, etc, you should be able to measure the period of the signal to
calibrate the clock.
- If you are using an external crystal on the dsp801, cut the jumpers 3 and
4, right next to the crystal. Otherwise, it might have problems oscillating.
- If you measure a PWM frequency WAY OFF 10kHz, you must be having a problem
with the PLL. Try running it at 60MHz and reconfigure the PWM and SCI to
match this frequency.

Hope this helps. If something is wrong, contact me. I might be able to help.
Mariano

Spanish version for Oscar:
===================
Este es el projecto que utilize para calibrar el dsp. Debes conseguir un
osciloscopio para ajustar la frequencia del reloj IPBus del controlador. Si
no consigues un osciloscopio, es imposible realizar el ajuste.

Usa el proyecto que te envio y fijate en la rutina principal. Ahi
encontraras dos pruebas: la primera configura el modulo PWM. Esto te dara
una frequencia de 10kHz con 50% de ciclo en los pines PWM0~5. Ejecuta el
codigo hasta que el dsp se encuentre con el primer debug. Cuando entre a
modo debug, podras acceder a la memoria del dsp mientras el PWM sigue
funcionando. La idea es que puedas ver la memoria desde el debugger,
especificamente el registro ISOCTL y lo ajustes desde alli. Si modificas el
valor del registro ISOCTL, deberas ver que la frecuencia del PWM varia.
Ajusta el valor de ISOCTL para que la frecuencia sea exactamente 10kHz.

Si la frecuencia que obtienes no es nada cercano a 10kHz, debes tener un
problema con el PLL. Trata de bajar la frequencia del PLL a 60MHz. Verifica
tambien que los puentes 3 y 4 de la tarjeta esten cortados. Los puentes
estan indicados en el esquematico de la tarjeta, justo detras del cristal.

El segundo test simplemente manda caracteres a traves del puerto SCI. Con el
osciloscopio puedes verificar que el periodo entre el start bit y el stop
bit concuerde con los 9600 bps configurados.

Espero que sirva y no dudes en consultarme si no funciono.
Saludos,
Mariano

----- Original Message -----
From: "zlewko" <>
To: <>
Sent: Thursday, January 29, 2004 9:58 PM
Subject: [motoroladsp] Clock Calibration / Reading Flash > Hi,
>
> I've been trying to get a serial interface up and running between a
> dsp56f801 and a pc however it appears that the baud rates are getting
> misaligned. I'm trying to set up the internal oscilator with the
> factory calibration data stored in flash. However I'm having problems
> finding out how to read this data out of flash. Does anyone have a
> procedure for or any examples of how to retreive this or any data out
> of flash without using the SDK? I've found plenty of examples of how
> to write to flash but not how to read it.
>
> Thanks
> -Zach > _____________________________________
> Note: If you do a simple "reply" with your email client, only the author
of this message will receive your answer. You need to do a "reply all" if
you want your answer to be distributed to the entire group.
>
> _____________________________________
> About this discussion group:
>
> To Join:
>
> To Post:
>
> To Leave:
>
> Archives: http://www.yahoogroups.com/group/motoroladsp
>
> More Groups: http://www.dsprelated.com/groups.php3 >


Attachment (not stored)
Calibrate.zip
Type: application/octet-stream

This remark must look stupid, but it took me one full day to realize this:

When you are viewing the memory contents with the debugger, check the "Swap
Endian" setting. By default, Codewarrior shows the LSB first and then the
MSB. While viewing the memory contents, goto MEMORY menu and verify that the
"Swap endian" setting is enabled. Now you will see the MSB first.

Regards,
Mariano

----- Original Message -----
From: "Mariano Filippa" <>
To: <>; <>; <>
Sent: Friday, January 30, 2004 11:38 AM
Subject: Fw: [motoroladsp] Clock Calibration / Reading Flash - ALLOW ZIP Here is how I did it. If you don't have an oscilloscope, try to get one.
Without one, it would be impossible.

Use the project I've included. Take a look at main. There are two tests: one
sets a PWM output. You should be able to measure the frequency and adjust
the oscillator until the frequency is ok.

The second test just sends characters at 9600bps through the SCI port. You
should be able to verify the period with a scope between the start and stop
bit.

Everything is explained in the main code "dsp_main.c". Should compile and
run right away. Don't worry about the extra code and functions. They will be
deadstripped. Before running, read the main routine for instructions.

Some notes:
- If you don't have an oscilloscope, don't bother trying. Get one, borrow
one, etc, you should be able to measure the period of the signal to
calibrate the clock.
- If you are using an external crystal on the dsp801, cut the jumpers 3 and
4, right next to the crystal. Otherwise, it might have problems oscillating.
- If you measure a PWM frequency WAY OFF 10kHz, you must be having a problem
with the PLL. Try running it at 60MHz and reconfigure the PWM and SCI to
match this frequency.

Hope this helps. If something is wrong, contact me. I might be able to help.
Mariano

Spanish version for Oscar:
===================
Este es el projecto que utilize para calibrar el dsp. Debes conseguir un
osciloscopio para ajustar la frequencia del reloj IPBus del controlador. Si
no consigues un osciloscopio, es imposible realizar el ajuste.

Usa el proyecto que te envio y fijate en la rutina principal. Ahi
encontraras dos pruebas: la primera configura el modulo PWM. Esto te dara
una frequencia de 10kHz con 50% de ciclo en los pines PWM0~5. Ejecuta el
codigo hasta que el dsp se encuentre con el primer debug. Cuando entre a
modo debug, podras acceder a la memoria del dsp mientras el PWM sigue
funcionando. La idea es que puedas ver la memoria desde el debugger,
especificamente el registro ISOCTL y lo ajustes desde alli. Si modificas el
valor del registro ISOCTL, deberas ver que la frecuencia del PWM varia.
Ajusta el valor de ISOCTL para que la frecuencia sea exactamente 10kHz.

Si la frecuencia que obtienes no es nada cercano a 10kHz, debes tener un
problema con el PLL. Trata de bajar la frequencia del PLL a 60MHz. Verifica
tambien que los puentes 3 y 4 de la tarjeta esten cortados. Los puentes
estan indicados en el esquematico de la tarjeta, justo detras del cristal.

El segundo test simplemente manda caracteres a traves del puerto SCI. Con el
osciloscopio puedes verificar que el periodo entre el start bit y el stop
bit concuerde con los 9600 bps configurados.

Espero que sirva y no dudes en consultarme si no funciono.
Saludos,
Mariano

----- Original Message -----
From: "zlewko" <>
To: <>
Sent: Thursday, January 29, 2004 9:58 PM
Subject: [motoroladsp] Clock Calibration / Reading Flash > Hi,
>
> I've been trying to get a serial interface up and running between a
> dsp56f801 and a pc however it appears that the baud rates are getting
> misaligned. I'm trying to set up the internal oscilator with the
> factory calibration data stored in flash. However I'm having problems
> finding out how to read this data out of flash. Does anyone have a
> procedure for or any examples of how to retreive this or any data out
> of flash without using the SDK? I've found plenty of examples of how
> to write to flash but not how to read it.
>
> Thanks
> -Zach > _____________________________________
> Note: If you do a simple "reply" with your email client, only the author
of this message will receive your answer. You need to do a "reply all" if
you want your answer to be distributed to the entire group.
>
> _____________________________________
> About this discussion group:
>
> To Join:
>
> To Post:
>
> To Leave:
>
> Archives: http://www.yahoogroups.com/group/motoroladsp
>
> More Groups: http://www.dsprelated.com/groups.php3 >