AvionicsMaster1 - yes, only changed the CONFIG part.
Does not matter if I delete the #CONFIG part from the code and set OSC=HS in the programmer... same result.
I tried indent, just now, with TAB as well with varying number of spaces...same result.
Contents of the Config line are as per PIC16F876A.INFO... see below.
Robert - all other aspects work correctly:-
The code determines the data from the incoming pulse stream and displays correctly on the 3 digit 7 seg display, operates a buzzer with a beep to advise on a new code being displayed etc. All this is based on pulse duration timings via interrupts and using Timer1.
Except for Serout it all appears to be working correctly.
My striped down code is as follows:-
define osc 8
include "modedefs.bas"
#CONFIG
__config _HS_OSC & _WDT_ON & _BODEN_ON & _PWRTE_ON & _CP_OFF & _LVP_OFF
#ENDCONFIG
' Setup Ports
ADCON0 = $00 'Disable AD ports
ADCON1 = $07 'Disable AD ports
Segments Var PORTC 'Data
LEDdigit Var PORTA 'Control
TRISC = $80 ' Set segment pins to output
TRISA = $f0 ' Set digit pins to output
PortC = $FF
PortA = $FF
TRISB = %00000011 ' Set RB0, RB1 i/p rest o/p
TRISA = %00001000 ' Set RA3 i/p rest o/p
USBport var PortB.5
Buzzer var PortB.4
Buzzer=0
ModeSw var PortB.1
Modesw=0
Once var bit ; added so print only occurs once
once=0
pause 1000
'=========== Print Header ==============
mainloop:
if once = 0 then
serout USBport,T9600,[12,"*** Diagnostic Code Unit v1.4 ***",13,10]
once = 1
endif
goto mainloop
Note that if I use :-
__config _HS_OSC & _WDT_OFF & _BODEN_OFF & _PWRTE_OFF & _CP_OFF & _LVP_OFF
Result is the same.
ALSO, I noticed in this post that the Indent is missing from the __CONFIG line.
The editor in this posting system must remove leading spaces.
It is there in MCSP.
Bookmarks