Timing issue using PDB to trigger DAC updates

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Timing issue using PDB to trigger DAC updates

Jump to solution
1,563 Views
ScottW
Contributor II

I am using the K60 tower and experimenting with using the PDB to trigger DAC updates, and have a question about the effect of the "Multiplier" property on the Init_PDB bean. 

I have DAC0 set to be hardware triggered via the PDB, and its in buffered mode with half a sine wave loaded into the 16 data registers.  I have it in swing mode so it will generated a sine wave for me.

I'm using a peripheral bus speed of  4Mhz, so when I have the multiplier set to "multiply by 1" and the prescaler set to "divide by 1", the PE displays the Counter Frequency as "4000.0000 kHz" which looks right.  I have the DAC0 Trigger interval value as 23, and it displays the Trigger interval time as 5.750us, which also looks right.  (BTW, it seems weird that I have to enter the raw counters rather than requesting a time in ms or us).  This generates a nice sine wave (well, nice enough given the step size) at about 5555Hz.  When I use a scope to measure the duration of the individual steps, it's 5.96us, which matches what the PE is telling me for the trigger interval.

Now, I switch the PDB multiplier to be "multiply by 10" and leave everything else the same.  The PE displays the counter frequency as 40000kHz and the DAC0 Trigger Interval Time as 0.575us.  But when I run this, my sine wave frequency is
555Hz and the oscilloscope-measured step size is 59.6us, which does_not_ agree with that the PE told me; it's different by a factor of about 100.

The K60 data sheet says this about the multiplier "This bit selects the multiplication factor of the prescaler divider for the counter clock." which makes it sound it should be slowing things down rather than speeding things up.

So, it looks to me like the PE is calculating the DAC0 Trigger Interval Time incorrectly.  Or, did I miss something?

I'm using CodeWarrior V10.1.

 

Thanks

0 Kudos
1 Solution
1,268 Views
ProcessorExpert
Senior Contributor III

Hello,

 

I have reproduced the problem, you are correct. Init_PDB shows incorrect values in all timing porperties in case "Multiplier" property is not set to the "multiply by 1" value.

 

For now as workaround please ignore all timing porperties in case "Multiplier" property is not set to the multiply by 1.

 

The problem will be fixed in the CodeWarrior V10.2.

 

However we will prepare hot-fix for the problem. I think it would be ready within a week. I will post it here when it will be ready.

 

best regards
Vojtech Filip
Processor Expert Support Team

 

 

View solution in original post

0 Kudos
2 Replies
1,269 Views
ProcessorExpert
Senior Contributor III

Hello,

 

I have reproduced the problem, you are correct. Init_PDB shows incorrect values in all timing porperties in case "Multiplier" property is not set to the "multiply by 1" value.

 

For now as workaround please ignore all timing porperties in case "Multiplier" property is not set to the multiply by 1.

 

The problem will be fixed in the CodeWarrior V10.2.

 

However we will prepare hot-fix for the problem. I think it would be ready within a week. I will post it here when it will be ready.

 

best regards
Vojtech Filip
Processor Expert Support Team

 

 

0 Kudos
1,268 Views
ProcessorExpert
Senior Contributor III

Hello,

 

Please find the enclosed hot-fix for your problem. Please note that the hot-fix is restricted to use only with CW 10.1 with installed Update #2 V1.0.1:

 

To aply it follow the steps below and in the readme.txt that is available in the archive:

 

  1. Install the fresh CW 10.1 or use alredy installed CW 10.1
  2. Instal the Update #2 V1.0.1 for CW V10.1
  3. Ensure you have an aministrator rights and the CodeWarrior is not running.
  4. Copy the content of this archive (without readme.txt file) into the CodeWarrior for MCUs V10.1 installation layout.

best regards
Vojtech Filip
Processor Expert Support Team

0 Kudos