Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Question About EX_SISR.C

Status
Not open for further replies.
V

VBDESIGNER

Guest
Newbie level 1
Hello

I´am trying to develop a rs232 minitouch screen app under rs232 whit 9600 bauds,reading the ccs example EX_SISR.c is the way for implementation however i have a trouble whit bkbhit part because i don´t need to wait for a key, i´m using a sync signal data to proccess however i don´t know how implement properly the interrupts to get the data.


Code:
do {
   
  
     delay_ms(250);
  
 
 
      putc(0x26)&putc(0x15)&putc(0X36)&putc(0x80)&putc(0X93); \\  sync data mandatory works properly
  
 
    while(bkbhit) \\ whit this the sync works properly whitout stops.
 
    
   






 
if ((bgetc()==(0x39,0X43,0x26))) { send whit realterm
  
   putc(0x39)&putc(0x68)&putc(0X27));  \\ vector data doesn´t work realterm receives nothing
    
 
  }
 
else if ((bgetc()==(0x39,0X44,0X29,))) { send whit realterm
  
   putc(0x39)&putc(0x72)&putc(0X35)); \\ vector works properly realtern receives this data
    
 
  }


tested whit Realterm and 16f876, i need to create 10 vector instructions however only validates one the buffer size are defiined to 16 i know that i need change but i need to know if this possible to replace the bkbhit option because if ideleted the sync signal and vector signals stops, reading other post they recommended printf, sprintf usage in my case it´s no posibble because i need some especial chars as data ENQ,VT,CR and another signals. my question is what i need to replace to keep the sync working and the vector instructions work. thanks for any reply about this.


Next
 

I was curious on this line:

Code:
 putc(0x26)&putc(0x15)&putc(0X36)&putc(0x80)&putc(0X93);

It is not a good way to send a string, due the order of execution could not be the same (at least, should not vary from a compiler to another). Another issue, is that the putc() which although has return value, it is not usual to put in a chain as it is.

With regard to the bgetc() function, at this line

Code:
(bgetc()==(0x39,0X44,0X29,)

It seems like it is missing some character, such as if the code were not compiled yet, but if it were, the lack of any compilation Error do not mean that the construct is correct.

In addition, note that bgetc() returns a single byte, not an array, and even if it were allowed, you could not compare strings with the '==' operator.

I would recommend you start with the original code to make the changes there, I would be glad to give tips.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top