Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
April 20, 2024, 03:45:47 03:45


Login with username, password and session length


Pages: [1]
Print
Author Topic: Error Trapping in CCS  (Read 6039 times)
0 Members and 1 Guest are viewing this topic.
LazBoy
Active Member
***
Offline Offline

Posts: 154

Thank You
-Given: 78
-Receive: 25


« on: February 02, 2006, 09:31:20 21:31 »

Dear friends,
I am beginner on C and CCS PIC C.
Want to error trapping at RS232 communication.

When connection lost, It must be wait 2 seconds and goto safe mode.

I did this in Basic:
Code:

SERIN PinRX,813,2000,safe_data,[CID,Byte1,Byte2,Byte3,CRC]  ' 1200 Baud TRUE


How can I do this in CCS ?

I tryed like this but not success:

Code:


Void commandRead(){

If (!kbhit())
    Error++;
    return;

value = getch();
....
....

Void Main();

  while(1){
  commandRead();
  if (Error>50000) SafeMode();
 }
....
....


Thank you.
Logged
LazBoy
Active Member
***
Offline Offline

Posts: 154

Thank You
-Given: 78
-Receive: 25


« Reply #1 on: February 04, 2006, 03:38:53 03:38 »

Problem solved.. There is Max232 connection problem..
Logged
Pages: [1]
Print
Jump to:  


DISCLAIMER
WE DONT HOST ANY ILLEGAL FILES ON THE SERVER
USE CONTACT US TO REPORT ILLEGAL FILES
ADMINISTRATORS CANNOT BE HELD RESPONSIBLE FOR USERS POSTS AND LINKS

... Copyright © 2003-2999 Sonsivri.to ...
Powered by SMF 1.1.18 | SMF © 2006-2009, Simple Machines LLC | HarzeM Dilber MC