At 04:14 PM 9/3/97 GMT, you wrote: >I have programmed microcontrolers, mostly MCS51 serie, but my >next project needs PIC programming. > >My problem is that I don't know how to send multiple strings over RS232. >I need a subroutine wich has a poniter to a string as a parameter. Igor, The attached routines are copied from a recently-completed project. If you need the interrupt-driven serial code (for chips with integrated USART like the '73) just ask me. Andy ;************************************************************************ ;* ;* Messages ;* ;************************************************************************ ; MSG:WriteChar movf temp3,W ; Get current character offset incf temp3,F ; Bump counter addwf PCL,F ; Look up byte to get MSG:MsgBase MSG:MD retw FF,' Montana Design ',ETX MSG:TShort retw CR,'Timing Light 1.0',ETX MSG:TLong retw CR,'Timing Light System version 1.0',CR,ETX MSG:Run retw '-- RUNNING ---',ETX MSG:NewBoat retw CR,'=== New Boat ===',ETX MSG:Abort retw FF,'==== ABORT =====',CR,ETX MSG:Abort2 retw CR,'Press [CLEAR] ',ETX MSG:Ready retw '---- READY -----',ETX MSG:DirectionBody retw '---',ETX MSG:Err1 retw FF,'Multiple Trips ',ETX org 0ffh ; NOTE - The end of last message must be at address 0x0FF or less MSG:WriteMontana movlw MSG:MD - MSG:MsgBase goto MSG:Write MSG:WriteTLong movlw MSG:TLong - MSG:MsgBase goto MSG:Write MSG:WriteTShort btfss out_RS232 call MSG:ClearLine1 movlw MSG:TShort - MSG:MsgBase goto MSG:Write MSG:WriteReady btfss out_RS232 call LCD:Clear movlw MSG:Ready - MSG:MsgBase goto MSG:Write MSG:WriteRunning btfss out_RS232 call LCD:Clear movf Direction,W call PUTCH movlw MSG:Run - MSG:MsgBase call MSG:Write movf Direction,W goto PUTCH MSG:WriteErr1 btfss out_RS232 call MSG:ClearLine1 movlw MSG:Err1 - MSG:MsgBase call MSG:Write movf Direction,W call PUTCH goto MSG:WriteAbort:out return MSG:WriteNewBoat movlw MSG:NewBoat - MSG:MsgBase goto MSG:Write MSG:WriteDirection movlw CR call PUTCH ; bcf RP0 movf Direction,W call PUTCH movlw MSG:Run - MSG:MsgBase goto MSG:Write movlw CR goto PUTCH MSG:WriteAbort btfss out_RS232 call MSG:ClearLine1 movlw MSG:Abort - MSG:MsgBase call MSG:Write ; This puts out the common message :out btfsc out_RS232 return movlw MSG:Abort2 - MSG:MsgBase goto MSG:Write ; This puts out the LCD-only part MSG:ClearLine0 movlw LCD_LINE0+0 goto MSG:ClearLine1:Go MSG:ClearLine1 ; Blank out line 1 movlw LCD_LINE1+0 :Go call LCD:GotoXY movlw 16 movwf temp3 :LoopClear movlw ' ' call LCD:Display decf temp3,F btfss Z goto :LoopClear call LCD:Home return MSG:WriteString movwf temp3 :Loop movf temp3,W movwf FSR movf INDIRECT,W btfsc Z return call PUTCH incf temp3,F goto :Loop ;**************************************************************************** ; ; Display the message pointed to by W on the LCD ; MSG:Write movwf temp3 :WriteLoop call MSG:WriteChar iorlw 0 btfsc Z return call PUTCH ; Write message to current device goto :WriteLoop ;************************************************************************ ; PUTCH ; void putch (char c) ; { btfss out_RS232 ; switch (io_device) ; { :lcd goto lcd_putc ; case io_lcd: lcd_putc (c); ; break; :rs232 goto rs232_putc ; case io_rs232: rs232_pu tc (c); ; break; ; default: lcd_putc (c); ; } ; } ; return ;PAGE ================================================================== Andy Kunz - Montana Design - 409 S 6th St - Phillipsburg, NJ 08865 Hardware & Software for Industry & R/C Hobbies "Go fast, turn right, and keep the wet side down!" ==================================================================