But if i use only one digital input and the rest as output, so no fancy stuff like EUSART and SSP. -----Oorspronkelijk bericht----- Van: piclist-bounces@mit.edu [mailto:piclist-bounces@mit.edu] Namens Nicola Perotto Verzonden: woensdag 27 augustus 2008 19:08 Aan: Microcontroller discussion list - Public. Onderwerp: Re: [PIC]16F685 all digital No! You need to correctly initialize EVERY peripheral. Nic Harry H. Arends wrote: > Hi Group, > > I have a question about using the 16F685 in a all digital mode. > Is this piece of code enough to set the device to all digital or have > i let something out? > > INIT: > clrf PORTA > clrf PORTB > clrf PORTC ;* > clrf CM1CON0 ;*Switch off Comparators > > BANKSEL ANSEL ;*Bank 1 > clrf ANSEL > clrf ANSELH > > BANKSEL TRISB ;*Bank 1 > movlw RB_TRIS ;*Set port B I/O configuration > movwf TRISB > movlw RA_TRIS ; Set port A I/O configuration > movwf TRISA > movlw RC_TRIS ;*Set port C I/O configuration > movwf TRISC > > clrf VRCON ; voltage reference off > movlw PIE1_INI > movwf PIE1 > movlw OPTION_INI ; Option register: no pull-up, no prescaler, wdt 1:1 > movwf OPTION_REG > BANKSEL 0x00 ;*Bank 0 > > Thanks > > Harry > -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist