--_002_urc7f9xpofln2hakerswarbrickdnsaliascom_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi again, (Drat: Forgot the [PIC] in the subject line. Sorry for those who get this twice) Adam Goldman very kindly pointed out to me that there's an update for PK2DeviceFile.dat which lets me program the PIC16F1824, so that's brilliant! Unfortunately, I've got a bit confused. The following trivial program should blink an LED on pin 6 about once every second or so. (Hopefully I've correctly chopped out the commented stuff from my rather larger file. The extended port setup is because the chip will actually be doing rather more than blinking an LED once I've fixed this problem!) #include __config _CONFIG1, _FCMEN_OFF & _IESO_OFF & _CLKOUTEN_OFF & _BOREN_OFF = & _CPD_OFF & _CP_OFF & _MCLRE_ON & _PWRTE_OFF & _WDTE_OFF & _FOSC_INTOSC __config _CONFIG2,b'10111011111111' UDATA_SHR TMPA res 1 TMPB res 1 ..ResetVector code h'0000' banksel ANSELA clrf ANSELA banksel TRISA movlw b'00001011' movwf TRISA banksel PORTA movlw b'00010000' movwf PORTA banksel PORTC clrf PORTC banksel ANSELC clrf ANSELC banksel TRISC movlw b'00000011' movwf TRISC goto main wait: clrf TMPA clrf TMPB wait_inner: incfsz TMPA, F goto wait_inner incfsz TMPB, F goto wait_inner return main: banksel PORTC bsf PORTC, 4 call wait bcf PORTC, 4 call wait goto main END Anyway, it doesn't do what I expected, and the program resets every two seconds. Adding clrwdt statements before each call to wait stops this happening. So I'm confused. I switched from using a binary string for _CONFIG1 to the symbolic constants to check that I was using the right values but, whether I choose _WDTE_OFF or _WDTE_ON, I get the same behaviour. There's nothing in the errata (and not being able to switch off the WDT would presumably have been noticed before release!) Can anyone spot what I've missed? Rupert PS: Also, does MPASM support any sort of line continuation characters? I couldn't see any mentioned in the user manual and "\" doesn't work, but maybe there's something else? --_002_urc7f9xpofln2hakerswarbrickdnsaliascom_ Content-Type: text/plain; name="ATT00001.txt" Content-Description: ATT00001.txt Content-Disposition: attachment; filename="ATT00001.txt"; size=208; creation-date="Tue, 07 Aug 2012 12:21:57 GMT"; modification-date="Tue, 07 Aug 2012 12:21:57 GMT" Content-Transfer-Encoding: base64 LS0gDQpodHRwOi8vd3d3LnBpY2xpc3QuY29tIFBJQy9TWCBGQVEgJiBsaXN0IGFyY2hpdmUNClZp ZXcvY2hhbmdlIHlvdXIgbWVtYmVyc2hpcCBvcHRpb25zIGF0DQpodHRwOi8vbWFpbG1hbi5taXQu ZWR1L21haWxtYW4vbGlzdGluZm8vcGljbGlzdA0K --_002_urc7f9xpofln2hakerswarbrickdnsaliascom_-- .