Hello Folks,
I am a noob when it comes to pic programin. so i am hoping to enlist the help from some of the experts of this forum. I have been having a heck of a time trying to compile a program using PBP 2.50B and MCS+ 3.0.05. I am trying to receive a serial 8N1 formated string @ 38.4K baud and output it at 9.6K baud. When i attempt tocompile i get the following errors:
I would appreciate any help and comments.Code:Error[108] c:pbp\pbppic18.lib 55 : Illeagal character (=) Error[124] c:pbp\pbppic18.lib 55 : Illeagal argument Error[108] c:pbp\pbppic18.lib 61 : Illeagal character (=) Error[124] c:pbp\pbppic18.lib 61 : Illeagal argument Error[108] c:pbp\pbppic18.lib 67 : Illeagal character (=) Error[124] c:pbp\pbppic18.lib 67 : Illeagal argument Error[108] c:pbp\pbppic18.lib 73 : Illeagal character (=) Error[124] c:pbp\pbppic18.lib 73 : Illeagal argument Error[108] c:pbp\pbppic18.lib 79 : Illeagal character (=) Error[124] c:pbp\pbppic18.lib 79 : Illeagal argument Error[108] c:pbp\pbppic18.lib 85 : Illeagal character (=) Error[124] c:pbp\pbppic18.lib 85 : Illeagal argument Error[108] c:pbp\pbppic18.lib 91 : Illeagal character (=) Error[124] c:pbp\pbppic18.lib 91 : Illeagal argument Error[108] c:pbp\pbppic18.lib 97 : Illeagal character (=) Error[124] c:pbp\pbppic18.lib 97 : Illeagal argument Error[108] c:pbp\pbppic18.lib 103 : Illeagal character (=) Error[124] c:pbp\pbppic18.lib 103 : Illeagal argument Error[108] c:pbp\pbppic18.lib 109 : Illeagal character (=) Error[124] c:pbp\pbppic18.lib 109 : Illeagal argument
thank you
here is the code:
Code:'Configuration Bits @ INCLUDE "P18F2220.INC" ;processor specific variable definitions @ LIST P=18F2220 ;directive to define processor and file format @ __CONFIG _CONFIG1H, _IESO_OFF_1H & _FSCM_OFF_1H & _ECIO_OSC_1H @ __CONFIG _CONFIG2L, _PWRT_OFF_2L & _BOR_ON_2L & _BORV_27_2L @ __CONFIG _CONFIG2H, _WDT_OFF_2H & _WDTPS_32K_2H @ __CONFIG _CONFIG3H, _MCLRE_ON_3H & _PBAD_DIG_3H & _CCP2MX_C1_3H @ __CONFIG _CONFIG4L, _DEBUG_OFF_4L & _LVP_OFF_4L & _STVR_OFF_4L ' Define Oscilator speed DEFINE OSC = 20 RCSTA = $FAB TXSTA = $FAC SPBRG = $FAF ' Disable Analog Ports ADCON1 = %00001111 ' Set all ports for digital operation ' Setup Imterups INTCON = %01000000 data_ready_to_send var bit UVSSIN var byte RCTOUT var byte 'Use any spare port bits for flow control. flow_control_input var PORTB.4 flow_control_output var PORTB.5 ' Configure the flow-control pins as one input and one output. TRISB.4 = 1 TRISB.5 = 0 TRISC.6 = 0 ' Setup pin RC6 to transmit TRISC.7 = 1 ' Assert the flow-control output to enable receiving data on the serial port. flow_control_output = 0 data_ready_to_send = 0 loop: ' The main program loop. gosub receive_serial_data gosub transmit_serial_data GOTO loop receive_serial_data: if (PIR1.5 = 1) then ' Tell the remote computer to stop sending data . flow_control_output = 1 Poke SPBRG, 32 ' A byte has arrived at the serial port. Read it. SERIN2 PORTC.6,32774,[RCTOUT] else data_ready_to_send = 1 endif return transmit_serial_data: if (data_ready_to_send = 1) then ' A byte is ready to send on the serial port. if (flow_control_input = 0) then ' The flow control input is asserted. Poke SPBRG, 129 ' Set baud rate to 9600 data_ready_to_send = 0 SEROUT2 PORTC.7\PORTC.4,84,[RCTOUT] ' Tell the remote computer it's OK to send more data. flow_control_output = 0 endif endif return


Your program don't use the USART as it use a bit-banged solution (SERIN2/SEROUT2). If you want to use the USART, have a look in your manual for HSEROUT/HSERIN


Bookmarks