Rikard Bosnjakovic wrote: > On 3/7/07, michael brown wrote: > >> Part of the problem is right here. You need to use INTOSC to be >> able to free up the OSC1 and OSC2 pins. It is only two speeds >> (37kHx and 4MHz), you set the speed using the OSCF bit in the PCON >> sfr. So instead of _ER_OSC_CLKOUT, you want something like >> "_INTRC_OSC_NOCLKOUT". If the assembler doesn't like that, try >> "_INTOSC_OSC_NOCLKOUT". Microchip has a problem with consitency on >> this stuff. Be careful with that LVP_ON stuff and trying to use >> /MCLR as an input pin, I'd change that too if I were you. > > That line is from the template-file from Microchip's MPLAB-tutorial, I > have no idea what the values are so I left them untouched. It seems Read about them, you need to know this stuff. They're just like option switches, you turn them on or off. You'll see that the CLKOUT stuff passes the Fosc/4 clock out a port pin making it unusable to you. The ER thingy is also tying up one of your port pins thinking that you have an external R/C connected to act as the clock. You could try this for your CONFIG word settings: __CONFIG _CP_OFF & _WDT_OFF & _PWRTE_ON & _BODEN_OFF & _LVP_OFF & _INTRC_OSC_NOCLKOUT > it's possible to change them from the menu in case I need it (which I > obviously seem to do). Yes, you do. Change the LVP option to OFF as well. It won't make any difference to the simulator, but it will to you when you start burning PICs for real. > But again, this is my first glance with PICs so I don't yet know all > this kind of black magic (the datasheet is pretty heavyweight and I > haven't got through it all). It does, however - according to what you > write, look like I've run into a problem since I need a > 32.768kHz-crystal. > > I guess I'll have to trim down the inputs to three and multiplex them > together using diodes. Ugh. Make sure you have this in your program too: movlw 0x07 ;turn of the comparators movwf CMCON When you get ready to buy some PICs think of the 16F88 instead of the 16F628. It's the newer model with more features (like ADC, nanowatt power consumption, INTOSC that runs at 8MHz w/1% accuracy). And it costs less too. It's pretty much backwards compatible with the 16F628, but does require a little different CONFIG word setup and a little different procedure to make PORTA pins digital i/o instead of analog. For example: ;Program Configuration Register 1 __CONFIG _CONFIG1, _CP_OFF & _CCP1_RB3 & _DEBUG_OFF & _WRT_PROTECT_OFF & _CPD_OFF & _LVP_OFF & _BODEN_OFF & _MCLR_OFF & _PWRTE_ON & _WDT_OFF & _INTRC_IO ;Program Configuration Register 2 __CONFIG _CONFIG2, _IESO_OFF & _FCMEN_OFF and for setting up PORTA to digital: ; select BANK 1 first movlw 0x00 ;All pins digital i/o for now movwf ANSEL & 0x7F ; don't forget to switch back to BANK 0 -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist