Mark E'silva Wrote
 
To all the piclisters that are still unsure what the problem is with the pic12c509A is
I am going to send for the last time what I have found...
 
Any Code written for a 12c509 pic running on the internal RC osc with a Oscal trim value set
more or less MID WAY runs 100% ok
 
Taking the exact same code and using it on a 12c509A  ,The code runs a LOT slower
even if the Oscal trim value is changed for MAXIMUM speed
 
To demonstrate this problem ,I wrote a simple program to compare the two pic's both on OTP's
and Window 12c509 ,12c509A pic's
 
 I am 100% aware of the increase in resolution of  the OSCAL trim value
on the 12c509A version as there are 5 bits in the oscal or 32 trim levels
assuming
that the Microchip Data sheet 1998 is correct and the sheet 1997 is
incorrect. as shown below

And on the 12c509 there are only 4 bits or 16 trim levels in the oscal reg
my setting on the 12c509 was  B'01100000' , This value is setting the oscal
trim
approx mid way as it ranges from B'0000xxxx' min value to B'1111xxxx'
maximum where x are unimplemented bits ,The reson for me using B'0110xxxx'
on the 12c509 as
it runs the code very close to same speed as if I were using an external XT
resonator
of 4 mhz , leaving enough RESOLUTION left to increase the speed at will.

Now if the same code is moved to a 12c509A with the Oscal setting MAXIMUM
B'11111xxx' then the 12c509A still doesn't run as fast as the 12c509 Which
to my
opinion is running as close as possible to a  4 Mhz resonator on the 12c509
but
on the 12c509A even with the oscal setting maximum it still runs well below
4 mhz  as shown in the test I did below.

Any Suggestions ?  Rewriting the code is NOT an option, only setting the
oscal
value is, As the 12c509 and 12c509A  ARE 100% equivalent ???????? Not to
mention
the higher resolution of OSCAL on the 12C509A?

 ;Our tests show that the Code writen bellow generates a 3.937 Khz tone
 ;on porta Ra5 with a 12c509 with oscal value B'01100000'
 ;And on a 12c509A it generates 3.827 Khz tone with oscal value B'11111100'
 ;which is the maximum speed setting.
 ;For a 12c509A I would write the Oscal value the same way but
 ;with differnt value B'11111100' "max speed"
 ;-------------------------------------------------------------------------------------------------------------
 ;(Ocacal register 8Fh) pin definitions as per data sheet 1997 for 12c509A
 ;-------------------------------------------------------------------------------------------------------------
 ;7=cal3     *
 ;6=cal2     *
 ;5=cal1     *
 ;4=cal0     *
 ;3=calfst   fast course trim
 ;2=calslw   slow course trim
 ;1=not implemented
 ;0=not implemented
 ;-------------------------------------------------------------------------------------------------------------
 ;(Ocacal register 8Fh) pin definitions as per data sheet 1998 for 12c509A
 ;-------------------------------------------------------------------------------------------------------------
 ;7=cal5     *
 ;6=cal4     *
 ;5=cal3     *
 ;4=cal2     *
 ;3=cal1     *
 ;2=cal0     *
 ;1=not implemented
 ;0=not implemented
 ;------------------------------------------------------------------------------------------------------------
 ;(Ocacal register 5h) pin definitions as per data sheet 1998 for 12c509
 ;------------------------------------------------------------------------------------------------------------
 ;7=cal3     *
 ;6=cal2     *
 ;5=cal1     *
 ;4=cal0     *
 ;3=not implemented
 ;2=not implemented
 ;1=not implemented
;0=not implemented

;---------------------------------------------------------------------------------------------------------------
If your code was originaly written for a 12c509 and then moved over to a 12c509A you will
notice a BIG difference in execution speed if your code is related to serial communications.
talking to an EEPROM ,recieving and sending at resonable high speed , If your merely switching
an led or a relay on or off at 1 sec intervals your problably would'nt notice a difference....
 
This problem was Addressed to "Microchip Support " , The pic list .
Anyone interested in that test code that I wrote to compare the 12c509 to 12c509A ,I will send it
gladly.
 
All the Pics with the "A" as in 12c509"A" are the later versions ,or the "DIE SHRINK" versions
to Reduce production costs...And we Cannot get a 12c509A to replace a 12c509 WITHOUT REWRITING THE CODE TO ACCOMMODATE A SLOWER RUNNING PIC....
 
Why Should that be nessesary as the pic 12c509 and the 12c509A are Equivalent ???????????
NOT TO MENSION THE INCREASED RESOLUTION ON THE NEW 12C509A....
 
 
 
Regards Mark E'silva
mark@fine.co.za
saver@pta.lia.net