LC60+CyclonePro+CW6.0: Trimming for FEI Mode: fbus=6.291456 MHz

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

LC60+CyclonePro+CW6.0: Trimming for FEI Mode: fbus=6.291456 MHz

4,366 Views
BasePointer
Contributor II
Hi,
 
I'm using low power external crystal 32768Hz and FEE mode for the bus frequency 6.291456 MHz with the settings below.
Ficgout = fext * P * N / R ; P=64, N=6, R=1  -> Ficgout = 12.582912 MHz, Fbus = 6.291456 MHz
 
I want to use FEI mode with the same frequency if any faults occur on external xtal.
In FEI mode: (243kHz / 7)* 64 * N / R ; N=6, R=1  -> Ficgout = 13.330286 MHz that needs trimming to be Ficgout = 12.582912 MHz.
 
Is it possible to say CyclonePro to do it so automatically?
 
Thanks,
BP.
Labels (1)
0 Kudos
9 Replies

509 Views
tonyp
Senior Contributor II
Make a copy of the relevant S8P (algorithm) file to the project's directory to preserve the original.
 
Then edit the TRIM line, something like this:
 
09BIT_TRIM=003A/003B/01/FFAF/FFAE/007A1200/
(the above is for QG8, yours may be slightly different, e.g., TRIM=)
 
and put the target bus frequency you need in the last section as hex.
 
In your case (bus 6291456 Hz), the hex number is 00600000.
 
But, my experience with Cyclone's trimming isn't the best.  It gets close but sometimes not as close as one would hope.  If you add your own trimming routine and have the devices calibrated after programming, you'll probably get better results.


Message Edited by tonyp on 2007-11-03 11:44 PM
0 Kudos

509 Views
BasePointer
Contributor II
Hi tonyp,
 
I modified 9s08lc60.s8p file such as below:
 
Code:
; TRIM_RANGE=08000000/40000000/00000064/ ;DCO Min 8Mhz/ DCO Max 40Mhz/ Divider 64WRITE_BYTE_AND_SYNC=2C/00000038/  ;ICGC1 Internal clock sourceWRITE_BYTE_AND_SYNC=10/00000039/  ;ICGC2 Bus Clock = 6.291456MhzHCS08_TRIM=003E/FFBE/00600000/    ;Trim the device

 
It works like I expect now, thank you.
The programmer gives a warning for modified s8p file. How can I recalculate CRC for it?
 
Thanks,
BP.
0 Kudos

509 Views
tonyp
Senior Contributor II
The two-byte CRC calculation at the end of the file, AFAIK, is P&E's secret.   But, you don't really have to worry about it as it only gives a warning (in case the modification was not intentional) and goes on to do the job.


Message Edited by tonyp on 2007-11-05 12:04 PM
0 Kudos

509 Views
BasePointer
Contributor II
Hi again,
 
I also wonder how CyclonePro calculates trim value?
Which of them is better for CyclonePro to do more accurate trim operation: higher bus frequency or lower bus frequency? Or is it independent from bus frequency?
 
Thanks,
BP.
0 Kudos

509 Views
tonyp
Senior Contributor II
Again, the actual trimming process used by Cyclone is only known to them.  I can only point you to AN2496 which describes what is involved if you want to do it yourself.


Message Edited by tonyp on 2007-11-05 02:53 PM
0 Kudos

509 Views
Zahar
Contributor IV
Bp,

In the FLASH programming algorithm we set the device to the desired frequency via the ICG
module configuration registers. We then trim the device to this frequency with the accuracy of .2%.
This is the most accurate trim that is allowed by the hardware architecture.

What you are doing is OK. However, you might get devices that will fail trim because of the 25% variance of the initial center frequency value.

In order to change the CRC of an algorithm it actually has to be re-generated by a P&E employee.

However, the CRC algorithm error is not fatal during a FLASH programming procedure.

Please let us know if you have anymore questions.

Best Regards,
Zahar
P&E
0 Kudos

509 Views
BasePointer
Contributor II
Dear Zahar,
 
Thank you for your fast response.
 
Accuracy of 0.2% is highly enough for me.
I also wonder what happens if trim procedure fails such as you mentioned.
Will it simply ignore the trim process with the nearest trim value or stop the whole programming process?
If I add a small capacitance to the BKGD line (such as 100pF), does it affect accuracy of trim operation?
 
Regards,
BP.
0 Kudos

508 Views
Zahar
Contributor IV
BP,

P&E actually executes a step function and measures how different trim/frequency values correspond to each other. That way we are able to achieve the accuracy of .2%. 

As far as modifying the algorithm file to remove the CRC warning message, P&E actually offers a special utilility called ADDCRC. It can be downloaded free of charge from P&E's website:

http://www.pemicro.com/support/download_processor.cfm?type=5

Please let me know if you have anymore questions.

Best Regards,
Zahar
P&E


0 Kudos

508 Views
MplsMan
Contributor II
Is there an instruction line I can add to the programming algorithm file to have the "PT - Program Trim Value" function executed automatically following (or as part of) the "PM - Program module" command?  Maybe something similar to the PROGRAMMING_ALSO_DOES_VERIFY entry in the 9S08ac16.s8p programming algorithm file?   
0 Kudos