> I've seen claims on this list (see thread "Hi-Tech C > Compiler - Demo Version Limitations", 4/8/03) and > elsewhere that the (free) PICC Lite C compiler can be > "coaxed" into supporting the 16F628 with an addition > to the piclite.ini file. Has anyone actually looked > at the code generated as a result? > > I can illustrate a problem I found using this tiny > example: > > #include > void main() > { > CMIE = 0; > CMCON = 0x07; > } > > For the 16F627 it generates this (correct) code: > > 03FA 1683main BSF STATUS, 0x5 > 03FB 130C BCF PIR1, 0x6 > 03FC 3007 MOVLW 0x7 > 03FD 1283 BCF STATUS, 0x5 > 03FE 009F MOVWF CMCON > 03FF 2804 GOTO exit > > For the 16F628 it generates this (INCORRECT) code: > > 03FB 1683main BSF STATUS, 0x5 > 03FC 130C BCF PIR1, 0x6 > 03FD 3007 MOVLW 0x7 > 03FE 009F MOVWF CMCON > 03FF 2804 GOTO exit > > The problem is that the generated 16F628 code does > not return to bank 0 from bank 1 before setting CMCON, > thus setting VRCON instead. > > Any comments (besides "you get what you don't pay > for :))? Yup, noticed that too, it seems some registers don't have their bank bits set properly when you "hack" it into 628 mode, very annoying, took me quite a while to figure out what was going one. Now that I know what to look for it isn't as bad, but still... I guess they purposely "sabotage" things this way. TTYL ---------------------------------- Herbert's PIC Stuff: http://repatch.dyndns.org:8383/pic_stuff/ -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.