ok,et away with... I've got it working - it did indeed need separate lines with pauses inbetween. This seems to be the least i can get away with...
ADCIN 0, DC_Level_IN ; Read the DC level as presented on RA0 (pin 19)
pause 30
HSEROUT [10]
pause 30
HSEROUT [13]
pause 30
HSEROUT [" Waiting for Threshold, DC Value In = ", DEC DC_Level_IN]
many thanks to all who took the time to help - it really was appreciated.
For the record, anyone finding this thread that's a newbie like me who wants their PICKIT2 board with an onboard PIC 16F690 to send serial data with the HSEROUT command, here's what I did (& to all you old hands, I'm sure there's a lot of stuff in here that ain't optimum - but it works for me!)...
@MyConfig = _XT_OSC & _WDT_ON & _MCLRE_ON & _CP_OFF
@MyConfig = MyConfig & _MCLRE_ON & _BOR_OFF
@ __config MyConfig
Include "modedefs.bas"
DEFINE OSC 4 ; sets the internal oscillator to 4MHZ (best for HSEROUT)
ANSELH=0
ANSEL=0
VRCON = %00000000 ' turns the Vref Module OFF by CLEARING bit7, 6, 4
CM1CON0 =0
CM2CON0 =0
CM2CON1 =0
ADCON0.0 = 1 ' turns the AD Converter OFF by CLEARING bit0
INTCON.0 = 0 ' clears the RABIF Flag (to 0), COULD be 1 on reset (unique to F690)
TRISB.6 = 1 ' some s*** to do with serout that I don't fully understand!
TRISB.7 = 1 ' more s*** to do with serout that I also don't fully understand!
'serial Port stuff...
rcsta.7=1 'SPEN serial port enable bit
define HSER_RCSTA 90h
define HSER_TXSTA 24h
'DEFINE HSER_SPBRG 92
DEFINE HSER_BAUD 2400 ;Set baud rate
DEFINE HSER_CLROERR 1
txsta.7=1 'CSRC : Clock Source Select bit 1 = internal clock
txsta.6=0 'TX9 : 9-bit Transmit Enable bit 0 = 8 bit.
txsta.5=1 'TXEN : Transmit Enable bit
txsta.4=0 'SYNC : USART Mode Select bit 0=asynch
txsta.3=0 ' N/A
txsta.2=1 'BRGH : High Baud Rate Select bit
txsta.1=0 'TRMT : Transmit Shift Register Status bit ( Read only )
txsta.0=0 'TX9D : 9th bit of transmit data. Can be parity bit.
TRISA=%11111111 ; set all Port A pins as inputs
TRISB=%00000000 ; set all Port B pins as OUTPUTS
TRISC=%00000000 ; set all Port C pins as OUTPUTS
PORTA = %00000000 ' Clear the port register latches
PORTB = %00000000
PORTC = %00000000
Bookmarks