HI John , 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? Regard Mark julian@fine.co.za Mark@fine.co.za >John Clark Wrote >I presume you are aware of the higher resolution of OSCAL on the 12C509A? > > >John Clark, Software Engineer >mailto:JohnC@inter-intelli.com >(317) 715-8175 (voice & fax) > >Interactive Intelligence, Inc. >3500 DePauw Blvd., Suite 1060 >Indianapolis, IN 46268-1136 >http://www.inter-intelli.com >> ;PROJECT ;Test Code for generating a known frequency to compare on a >> 12c509A >> ;NO EEPROM >> ;DONE BY :MARK E'SILVA >> ;COMPANY :DIGITRON >> ;ASSEMBLER :MPASMWIN >> ;Info :Note the oscal value has been set at the reset vector 3FFh and >> ; also at 0FFh as the Promate programmer software first reads 3FFh >> ; for the oscal value then Overwrites this value to 3FFh on >> ; programming of the 12c509. As this value is not always constant >> ; for all 12c509's when reading a device, I set the oscal value >> ; twice as a precaution to prevent a read of the Default value >> ; Overwriting my value in 3FFh ,So even if it does overwrite 3ffH >> ; With an unknown or default value it is changed at 0FFh to My >> ; value and written to oscal register 5h at Org 000h >> ; >> ;The problem is that even if the ocsal trim value on the new 12c509A >> ;Is set for Maximum speed it Still doesn't seem to run the code at >> ;the correct speed but runs to slow. All our code has been writen for >> ;the old 12c509 with a value of 96 writen to oscal and we would like >> ;to use the new 12c509A to replace the old 12c509 >> ; >> ;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 >> ;-------------------------------------------------------------------------