Help Me On This Program Plz ?! Any Sudgestion...!

Discussion in 'Programmer's Corner' started by INX, May 31, 2007.

  1. INX

    Thread Starter New Member

    Apr 30, 2007
    3
    0
    HELLO, I AM WORKING ON MY MINI-PROJECT AND IT'S ABOUT SEND SERIAL DATA FROM SIGNAL ON PORTA.0 OF PIC 16F877A...I CONVERT THE SIGNAL THEN I SEND DATA TO PC U SING MAX...THEN ON THIS PROJECT I WANT TO SEND DATA WRITEN ON KEY BOARD OF THE PC TO AN LCD...I WROTE THE HOLE PROGRAM BUT THE ONLY PROBLEM IT'S :
    - FIRST LET TALK ABOUT THE PROGRAM HOW IT WORK...first i work on typing and sending data to lcd then about converting signal applaied on portA...i put an option the program can't send data without typing the number "1"...So the problem is here...when it start sending data of signal, it stop sending caracters typed on keyboard...he still working all the time in the loop signal...how can i resolve this problem it tried every thing, i tried interrupt but it take only one data from the signal or he take data with each caracter...any ideas plz sorry about my englis bcz i am frensh educated so thx for every one and hope u can help me about this plz can u send ur sudgestion on inx_z@hotmail.com thank you


    that's the program:

    DEVICE 16F877
    XTAL = 10
    DECLARE LCD_DTPIN PORTD.4
    DECLARE LCD_RSPIN PORTC.0
    DECLARE LCD_ENPIN PORTC.5
    cls
    HSERIAL_BAUD = 9600 ' Set baud rate to 9600
    HSERIAL_RCSTA = %10010000 ' Enable serial port and continuous receive
    HSERIAL_TXSTA = %00100000 ' Enable transmit and asynchronous mode
    HSERIAL_CLEAR = ON ' Optionally clear the buffer before receiving
    INPUT PORTA

    TRISD=0
    ADCON1=0X0E
    DIM VAR1 AS FLOAT
    DIM VAR2 AS FLOAT
    DIM SERDATA[1] AS BYTE
    DIM I AS BYTE

    TOTO:
    INC I
    WHILE I > 16
    CURSOR 2,1
    GOTO TOTO
    WEND
    IF SERDATA[0]<>"1" THEN
    HSERIN [STR SERDATA\1]
    PRINT STR SERDATA\1
    GOTO TOTO
    ELSE GOTO SIGNAL
    ENDIF

    (when i push on 1 on the keyboard it still working in this loop)

    SIGNAL:
    WHILE 1
    VAR1= ADIN 0
    VAR2=(VAR1*0.0195/255.0)
    HSEROUT [DEC VAR2,13]
    DELAYMS 50
    GOTO SIGNAL
    wend
     
  2. lightingman

    Senior Member

    Apr 19, 2007
    374
    22
    Hi...I will dump this code into an 877 over the weekend and see if I sort out your little problem.I will get back to you next week, unless you or someone sorts it before hand....Speak soon.....Daniel.
     
Loading...