|
gets function giving problemNext Thread | Thread List | Previous Thread Start a Thread | Settings | Details | Message |
|---|
Read-Only Author Ameya Hardikar Posted 6-May-2008 22:02 Toolset C51 |  gets function giving problem Ameya Hardikar Dear All, I am trying to read some float values/strings from a serial port. A VB based front end application sends me these values over a serial port.The communication between the front end application and firmware is ok. i.e. I am able to read single characters send by application and application is able to read values which my firmware is sending. But whenever I try to read values from serial port using gets function or scanf function then sometimes it works and sometimes not. And when it works 'gets' does not assigns all values received to the string variable. e.g. if i am receiving "Ameya" then only "mey" is received. At the same time this code works fine on a keil debugger. I am using customized forms of putchar() and _getkey() functions... Also I have tried sending CR/LF characters from VB application for which gets waits..but the problem still persists. I am wondering if it is working with keil debugger what could be problem..? Please help me .. | | Read-Only Author erik malund Posted 7-May-2008 05:31 Toolset C51 |  a guess erik malund At the same time this code works fine on a keil debugger. assuming you mean 'simulator' by 'debugger' my guess is that the baudrate is a bit off. verify it here http://www.keil.com/c51/baudrate.asp Erik | |
Next Thread | Thread List | Previous Thread Start a Thread | Settings |
|