DSPRelated.com
Forums

Problems 8013: Boot - FastIRQ - ADC

Started by radiorama1976 December 5, 2005
Hello group,

my name is Carlo and I am a new member.
I'm developing with the MC56F8013 DSP demo board and I'm having some
trouble.

Problem #1: I cannot get the DSP to boot up properly in standalone
mode, when disconnected from the PC. I use the C+ASM stationery. The
startup code which copies variables from FLASH to RAM at startup seems
to work properly. I program the DSP, disconnect the demo board from
the JTAG programmer, power down, power up again. The DSP rarely boots
up succesfully (this is very strange, it would be more straightforward
if it *never* booted up...)

Problem #2: I'm using fast interrupt for PWM reload. It seems to be
working right, but the FRTID instruction is all but delayed: if I put
the last two instructions of the ISR after the FRTID instruction, they
are never executed. Am I missing something here?

Problem #3: the A/D converter shows some imprecision when synchronized
with the PWM generator through TMR3.
I'm converting all six signals in simultaneous mode (ANA0 with ANB0,
ANA1 with ANB1, ANA2 with ANB2), triggered by the TMR3 output.
The first two samples (ANA0 and ANB0 in this case) are very noisy when
the input voltage is close to 0 V. The other samples are always OK.
This does not happen when the conversion is triggered by asserting the
START0 bit.
I got a temporary solution to this problem by sampling ANA0 and ANB0
twice and discarding the first conversion, but I'd rather prefer to
fix it because the conversion is no more synchronized with the PWM
signal generation.

Any ideas greatly appreciated!

Best regards,
Carlo.


1)8013/4 Codewarrior stationery has a bug which SP
isn't initialized before jsr F_trim instruction in
MC56F801x_init.asm file. You need to modify this file
as shown below by commenting out "jsr F__trim" and
copying segment of "get trim value and set trim reg"
from MC56F801x_trim.asm into MC56F801x_init.asm. Also
see attachment. So that why Freescale always recommeds
to use PE stationery.

**************************************************
; utility

; jsr F__trim ; get trim value and
set trim reg

; get trim value and set trim reg

move.l #OSCTL,R1 ; set R1 and R0 to OSCTL
move.l #OSCTL,R0
move.w X:(R0),A ; set A to current OSCT value
move.w #-1024,B ; set B to mask
and.w A,B ; mask A
move.l #FMOPT1,R0 ; set R0 to factory-flashed
trim value
move.w X:(R0),A ; set A
or.w B,A ; or A and B to get full OSCTL
value
move.w A1,X:(R1) ; set OSCTL

rts
; setup the PLL (phase locked loop)
.
.
.
*****************************************

2)Instructions after FRETD must be the single word and
single cycle instruction

3) If your silicon date code is 0443, the ADCs on that
silicon have a bug which may cause the first
conversion corrupted.

Good luck!

C.W.

--- radiorama1976 <radiorama@radi...> wrote:

> Hello group,
>
> my name is Carlo and I am a new member.
> I'm developing with the MC56F8013 DSP demo board and
> I'm having some
> trouble.
>
> Problem #1: I cannot get the DSP to boot up properly
> in standalone
> mode, when disconnected from the PC. I use the C+ASM
> stationery. The
> startup code which copies variables from FLASH to
> RAM at startup seems
> to work properly. I program the DSP, disconnect the
> demo board from
> the JTAG programmer, power down, power up again. The
> DSP rarely boots
> up succesfully (this is very strange, it would be
> more straightforward
> if it *never* booted up...)
>
> Problem #2: I'm using fast interrupt for PWM reload.
> It seems to be
> working right, but the FRTID instruction is all but
> delayed: if I put
> the last two instructions of the ISR after the FRTID
> instruction, they
> are never executed. Am I missing something here?
>
> Problem #3: the A/D converter shows some imprecision
> when synchronized
> with the PWM generator through TMR3.
> I'm converting all six signals in simultaneous mode
> (ANA0 with ANB0,
> ANA1 with ANB1, ANA2 with ANB2), triggered by the
> TMR3 output.
> The first two samples (ANA0 and ANB0 in this case)
> are very noisy when
> the input voltage is close to 0 V. The other samples
> are always OK.
> This does not happen when the conversion is
> triggered by asserting the
> START0 bit.
> I got a temporary solution to this problem by
> sampling ANA0 and ANB0
> twice and discarding the first conversion, but I'd
> rather prefer to
> fix it because the conversion is no more
> synchronized with the PWM
> signal generation.
>
> Any ideas greatly appreciated!
>
> Best regards,
> Carlo.

__________________________________________
Yahoo! DSL Something to write home about.
Just $16.99/mo. or less.
dsl.yahoo.com


Charlie W wrote:

> 1)8013/4 Codewarrior stationery has a bug which SP
> isn't initialized before jsr F_trim instruction in
> MC56F801x_init.asm file.

Very weird bug! I'm assuming the JTAG interface sets up the stack pointer
before executing the code.

> ; utility
>
> ; jsr F__trim ; get trim value and
> set trim reg
>
> ; get trim value and set trim reg
>
> move.l #OSCTL,R1 ; set R1 and R0 to OSCTL
> move.l #OSCTL,R0
> move.w X:(R0),A ; set A to current OSCT value
> move.w #-1024,B ; set B to mask
> and.w A,B ; mask A
> move.l #FMOPT1,R0 ; set R0 to factory-flashed
> trim value
> move.w X:(R0),A ; set A
> or.w B,A ; or A and B to get full OSCTL
> value
> move.w A1,X:(R1) ; set OSCTL
>
> rts

Your modification works, thanks! Of course the rts instruction is not needed
here :)

> 2)Instructions after FRETD must be the single word and
> single cycle instruction

Ah... I didn't find this information anywhere on the manuals...

> 3) If your silicon date code is 0443, the ADCs on that
> silicon have a bug which may cause the first
> conversion corrupted.

It is 0443 indeed.
Thanks for your insight!

Best regards,
Carlo.


Freescale already fixed ADC bug. Now you can order new
device from distributors, which has a great ADC
performance.

Charlie

--- Carlo <radiorama@radi...> wrote:

> Charlie W wrote:
>
> > 1)8013/4 Codewarrior stationery has a bug which SP
> > isn't initialized before jsr F_trim instruction in
> > MC56F801x_init.asm file.
>
> Very weird bug! I'm assuming the JTAG interface sets
> up the stack pointer
> before executing the code.
>
> > ; utility
> >
> > ; jsr F__trim ; get trim value
> and
> > set trim reg
> >
> > ; get trim value and set trim reg
> >
> > move.l #OSCTL,R1 ; set R1 and R0 to OSCTL
> > move.l #OSCTL,R0
> > move.w X:(R0),A ; set A to current OSCT
> value
> > move.w #-1024,B ; set B to mask
> > and.w A,B ; mask A
> > move.l #FMOPT1,R0 ; set R0 to factory-flashed
> > trim value
> > move.w X:(R0),A ; set A
> > or.w B,A ; or A and B to get full
> OSCTL
> > value
> > move.w A1,X:(R1) ; set OSCTL
> >
> > rts
>
> Your modification works, thanks! Of course the rts
> instruction is not needed
> here :)
>
> > 2)Instructions after FRETD must be the single word
> and
> > single cycle instruction
>
> Ah... I didn't find this information anywhere on the
> manuals...
>
> > 3) If your silicon date code is 0443, the ADCs on
> that
> > silicon have a bug which may cause the first
> > conversion corrupted.
>
> It is 0443 indeed.
> Thanks for your insight!
>
> Best regards,
> Carlo.