i ented a couple of lines to try to debug the problem...
Here is the startup sequence...
And on the PC I get "INITIALISING" and nothing else...Code:include "bs1defs.bas" Define CONF_WORD = 0x3F3A Define OSC 24 ' Set clock speed DEFINE SER2_BITS 8 ' Ser2 number of data bits SEROUT2 PORTD.0,16468,["INITIALISING",10,13] Define ADC_BITS 10 ' Set number of bits in result Define ADC_SAMPLEUS 10 ' Set sampling time in uS ADCON0.7 = 0 ' ADC clock set to Fosc/2 ADCON0.6 = 0 ' ADC clock set to Fosc/2 ADCON1.6 = 0 ' ADC clock set to Fosc/2 INTCON = 0 ' Disable all interupts 'RCSTA = %10010000 ' Enable serial port and continuous receive 'TXSTA = %00100100 ' Enable transmit and asynchronous mode with BRGH 1 'SPBRG = 20 ' Set baud rate to 57600 with 20mhz clock (BRGH = 1) ADT1 var word ' Create ADT1 to store curent ad conversion for AD channel 0 ADT1MAX var word ' Create ADT1MAX to store curent ADC0 max val ADT1MAX = 0 ADT1VAL var word ADT1VAL = 0 ADV1 var word VOLT1H var word VOLT1L var word C1N var bit C1N = 0 C1S var bit C1S = 0 PCOUNTER var byte PCOUNTER = 0 PTICK var bit PTICK = 0 RPM var word RPM = 0 TMR1_VAL var word TMR1_VAL = 0 TRISE = 255 ' Set PortE to all inputs TRISD = 0 ' Set PortD to all outputs TRISC = 0 ' Set PortC to all outputs TRISB = 0 ' Set PortB to all outputs TRISA = 255 ' Set PORTA to all input ADCON1 = 0 ' PORTA is analog PIE1.0 = 0 ' Disable TMR1 interupt (double check) T1CON.5 = 1 ' Setup TMR1 timings T1CON.4 = 1 T1CON.3 = 1 T1CON.1 = 0 T1CON.0 = 1 PORTB = 0 PORTC = 0 PORTD = 0 SEROUT2 PORTD.0,16468,["INITIALISED",10,13]
So somewhere between INITIALISING and INITIALISED things go wrong...




Bookmarks