Interesting,
What programmer hardware and software?
Peg
Hi Conrad,
QY's (at least) come with the factory's recommended trim already flashed at FFC0.
I just took a look at three brand new QY4's and this is what I found:
$FFCO, $FFC1
$7D, $6D
$85, $79
$65, $59
So on this very small sample the value in $FFC1 does seem to be somehow related to the trim value.
BR Peg
Hi Alban,
Sounds feasable...
Had that coffee now then???
Peg
Hi Alban,
Did some experimenting and this is what I found, using QY's.
In monitor mode if you are using the internal OSC (reset vector blank) the value at $FFC0 is transferred to $38 OSCTRIM unless it is $FF (blank). This means if you try to run a mass erased device in this mode it will only work if the device happens to have a OSC that requires a trim value close to the default value of $80.
If its too far off you might connect but then fail to programme the FLASH. If its even further off you won't connect at all. So you will have to provide a 9.8304 MHz clock to get back in.
The value programme at the factory into $FFC1 seems never to be accessed by the monitor.
It also seems to be too much lower than the value at $FFC0 to be a TRIM value for a Vcc of 3V. With the devices I tested before I found that the TRIM value needed to be changed by approx -1.5% to account for the reduced voltage whereas the difference between the two flashed values is more like -2.6%.
Anyway hopefully somebody knows more than me can fill us in.
BR Peg
Oh OK,
My 5V values where a fair bit different from the factory anyway and I now also notice that the greatest deviation from the 5V value comes at 3.5V and not 3V as well. (according to some samples in AN2312)
Peg
I did work too long with these And I had my famous coffee LOL
As Peg mentions, the voltage is indeed quite an important factor because the Internal Clock Generator is an RC filter. It depends at which voltage the factory trim was performed. My wild guess would be the typical value of the datasheet, but this is not a suggestion, just a guess...
Furthermore, on the first generation of ICG, like in EY, QYx (but OK in QYxA, nor QB, nor EYxA) you could have some surprises if you follow AN2498 and chose a value multiple of 8.
Only if you do use these, I advise to do the trim twice: once starting from whatever status the MCU is in (i.e. trim erased) and once again from the value calculated. The algo will also avoid values dividable by 8.
Cheers,
Alban. {coffee & MCU breaker}
Hi Alban,
Perhaps you could try to explain again as I am not sure what you are trying to say.
Are you saying the trim method employed in AN2498 is faulty or there is a problem with the devices or what. I am currently using QY4 and QY2 (not A)
BR Peg
Hello,
I never mentioned about the value in FFC1. It is FF after erasure of the flash. I allways trim the chips myself. If youe erase the flash without the user Monitor and teh flash block protection this location is erased too ind i do not reprogram it. Never hat a problem with it. So I believe it is not used.
Eckhard