Hi,
I'm trying to do almost the same as RuudNL but I'm having some trouble to make it work.
From the Serial Communicator (MECANIQUE), using a FTDI TTL232R serial cable, I send a command identifier and a value to the PIC.
Unfortunately, the PIC doesn't react to the incoming data.Code:' ====== FUSES ==================================================================================== ' PIC 12F683 @ __CONFIG _FCMEN_OFF &_IESO_OFF &_BOD_OFF &_CPD_OFF &_CP_OFF &_MCLRE_OFF &_PWRTE_OFF &_WDT_OFF &_HS_OSC ' ====== REGISTERS ================================================================================ ' Registers 76543210 ANSEL = %00000000 'Disable analog inputs ADCON0 = %00000000 'ADC is OFF CMCON0 = %00000111 'Comparator is OFF OPTION_REG = %10000000 'Pull-Ups disabled TRISIO = %00000001 'Inputs/Outputs GPIO = %00000000 'High/Low ' ====== DEFINES ================================================================================== DEFINE OSC 8 ' ====== VARIABLES ================================================================================ TX_ON var GPIO.2 'LED DataIn var GPIO.0 Switch var byte BdRate var WORD ' ====== INITIALIZE =============================================================================== TX_ON = 0 Switch = 0 BdRate = 49236 '9600 OIN ' ====== PROGRAM ================================================================================== MAIN: SERIN2 DataIn,BdRate,[WAIT("Identifier"),Switch] IF Switch = 1 THEN TX_ON = 1 IF Switch = 0 THEN TX_ON = 0 GOTO MAIN END
I might not use the correct syntax in the Serial Communicator.
Do I have to type something different as this here:
Thanks for any help.




Bookmarks