Hello Dave,
pickit buyed and running, I've too mounted a 18 pin in a board connected with the ICSP signal.
It's all ok with pic 16f628, but with 18f88 have this alarm message
The code :
'************************************************* ***************
'* Name : CONTROLLER.BAS *
'* Author : [select VIEW...EDITOR OPTIONS] *
'* Notice : Copyright (c) 2008 [select VIEW...EDITOR OPTIONS] *
'* : All Rights Reserved *
'* Date : 26/11/2008 *
'* Version : 1.0 *
'* Notes : *
'* Chip : PIC16F88 *
'************************************************* ***************
INCLUDE "MODEDEFS.BAS"
TRISA = %11111111 'RA.0:3 Input
TRISB = %00000000 'all PORTB output
ANSEL=%00000001'only porta.0 is analogue
ADCON1=%00000010'right justify the result(top bits are read as zero)
CMCON = 7 'Turn off comparators
adval VAR BYTE
i var BYTE
RPM VAR BYTE
' Define ADCIN parameters
Define ADC_BITS 8 ' Set number of bits in result
Define ADC_CLOCK 3 ' Set clock source (3=rc)
Define ADC_SAMPLEUS 50 ' Set sampling time in uS
PAUSE 500
loop:
ADCIN 0,adval
serout PORTB.6,n2400, [$FE, 1]
serout PORTB.6,n2400, [$FE, 2, "pressione ", #adval]
serout PORTB.6,n2400, [$FE, $C0, "giri", #rpm]
IF adval < 90 THEN
HIGH PORTB.4
endif
IF adval > 120 THEN
LOW PORTB.4
endif
COUNT PORTA.2,250,RPM
for i = 1 to rpm
toggle PORTB.5
PAUSE 25
NEXT i
LOW PORTB.5
GOTO loop 'repeat
Any help will be apreciated,
Thanks a lot
giorgio





Bookmarks