Click here to Skip to main content
15,921,989 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: WIN32 & WIN32s Pin
Alexander M.,24-Jul-03 2:58
Alexander M.,24-Jul-03 2:58 
GeneralUNICODE vs. _UNICODE Pin
peterchen23-Jul-03 23:10
peterchen23-Jul-03 23:10 
GeneralRe: UNICODE vs. _UNICODE Pin
Ryan Binns24-Jul-03 1:28
Ryan Binns24-Jul-03 1:28 
Generaltotal mouse control for an application Pin
Raphael Kindt23-Jul-03 22:53
Raphael Kindt23-Jul-03 22:53 
GeneralRe: total mouse control for an application Pin
peterchen23-Jul-03 23:32
peterchen23-Jul-03 23:32 
GeneralInfrared socket error Pin
elite1223-Jul-03 22:50
elite1223-Jul-03 22:50 
GeneralRe: Infrared socket error Pin
geo_m26-Jul-03 4:58
geo_m26-Jul-03 4:58 
QuestionHave anyone an idea? Pin
Nuehli23-Jul-03 22:36
Nuehli23-Jul-03 22:36 
I maked a test application for my HF-Transceiver. To communicate between PC and the Evolationboard of the HF-Transceiver I use the COM Port. I can't use the normal functions for serial communication, because my own telegramm to the transceiver don't have any Start or Stopbits. So I use the functions _inp and _outp to communicate directly with the register from the COM Port at adress 3F8 (COM1). To send the Data I used for synchronization an external clock signal, which I conacted to the CTS Pin. Now, I tested my programm and not all telegramm were correctly send. I modificated my programm to send only 01 as data for testing. With an oscilloscop I meased the CLOCK and DATA pin. I saw the error, the 01 intervall wasn't correctyl send. The error look like this.

CLOCK 01010101010101010101010101
0DATA 00110011001100001100110011
ERROR ( 4 * 0 is not correct)

It's funny, the CLOCK have 4600 baud normally. If i increase the baud rate to 19200 baud, no more error will be found. I don't know, if the problem is windows, because my thread can be stopped by windows, for short time. Or the problem come's from my code. This is my code for my send thread. I hope anyone have an IDEA or anyone can say an Internet adress to this theme THANKS!!!

bool m_bSendBit=false;<br />
bool lastBitOne;<br />
bool lastDataOne=false;<br />
<br />
// Init the clock signal<br />
if(_inp(m_ComBasisAdresse+6)&16)<br />
 lastBitOne=true;<br />
else <br />
 lastBitOne=false;<br />
	<br />
while(!m_bSendBit)<br />
{<br />
 if((_inp(m_ComBasisAdresse+6)&16)&&!lastBitOne)<br />
 { // CLOCK = 1<br />
  m_bSendBit=true;<br />
  lastBitOne=true;<br />
 }<br />
 else if(((_inp(m_ComBasisAdresse+6)|65519)==65519)&&lastBitOne)<br />
 { CLOCK = 0<br />
  m_bSendBit=false;<br />
  lastBitOne=false;<br />
 }<br />
}	<br />
// MAIN LOOP for SENDING<br />
while(m_bRunFlag)<br />
{	<br />
 m_bSendBit=false;<br />
 for(int i=0;i<m_sDatatelegramm.GetLength();i++)<br />
 {<br />
  while(!m_bSendBit)<br />
  {<br />
   if((_inp(m_ComBasisAdresse+6)&16)&&!lastBitOne)<br />
   {//CLOCK = 1<br />
    m_bSendBit=true;<br />
    lastBitOne=true;<br />
   }<br />
   else if(((_inp(m_ComBasisAdresse+6)|65519)==65519)&&lastBitOne)<br />
   {//CLOCK = 0<br />
    m_bSendBit=false;<br />
    lastBitOne=false;<br />
    }<br />
  }<br />
	<br />
  if(!lastDataOne)<br />
  { // DATA = 1 <br />
    _outp(m_ComBasisAdresse+3,64);<br />
    lastDataOne=true;<br />
  }<br />
  else<br />
  { // DATA = 0<br />
   _outp(m_ComBasisAdresse+3,0);<br />
   lastDataOne=false;<br />
   }<br />
   m_bSendBit=false;<br />
 }<br />
 // Last synchronization at end of telegramm<br />
 while(!m_bSendBit)<br />
 {<br />
  if((_inp(m_ComBasisAdresse+6)&16)&&!lastBitOne)<br />
  {<br />
   m_bSendBit=true;<br />
   lastBitOne=true;<br />
  }<br />
  else if(((_inp(m_ComBasisAdresse+6)|65519)==65519)&&lastBitOne)<br />
  {<br />
    m_bSendBit=false;<br />
    lastBitOne=false;<br />
   }<br />
  }<br />
 _outp(m_ComBasisAdresse+3,0);<br />
  Sleep(2);<br />
}

AnswerRe: Have anyone an idea? Pin
Toni7824-Jul-03 0:31
Toni7824-Jul-03 0:31 
GeneralRe: Have anyone an idea? Pin
Nuehli24-Jul-03 0:52
Nuehli24-Jul-03 0:52 
GeneralRe: Have anyone an idea? Pin
Toni7824-Jul-03 1:46
Toni7824-Jul-03 1:46 
GeneralParallel Lines Pin
Paul Selormey23-Jul-03 21:55
Paul Selormey23-Jul-03 21:55 
GeneralRe: Parallel Lines Pin
Dominik Reichl23-Jul-03 22:01
Dominik Reichl23-Jul-03 22:01 
GeneralRe: Parallel Lines Pin
Cedric Moonen23-Jul-03 22:16
Cedric Moonen23-Jul-03 22:16 
GeneralRe: Parallel Lines Pin
Ryan Binns24-Jul-03 1:37
Ryan Binns24-Jul-03 1:37 
GeneralRe: Parallel Lines Pin
Bob Stanneveld24-Jul-03 1:39
Bob Stanneveld24-Jul-03 1:39 
GeneralRe: Parallel Lines Pin
Paul Selormey24-Jul-03 1:55
Paul Selormey24-Jul-03 1:55 
GeneralRe: Parallel Lines Pin
Bob Stanneveld24-Jul-03 2:09
Bob Stanneveld24-Jul-03 2:09 
GeneralRe: Parallel Lines Pin
Paul Selormey24-Jul-03 2:23
Paul Selormey24-Jul-03 2:23 
QuestionLocal domain name and adapters? Pin
Dominik Reichl23-Jul-03 21:48
Dominik Reichl23-Jul-03 21:48 
AnswerRe: Local domain name and adapters? Pin
Toni7824-Jul-03 0:08
Toni7824-Jul-03 0:08 
GeneralRe: Local domain name and adapters? Pin
Dominik Reichl24-Jul-03 0:59
Dominik Reichl24-Jul-03 0:59 
GeneralRe: Local domain name and adapters? Pin
Toni7824-Jul-03 1:16
Toni7824-Jul-03 1:16 
AnswerRe: Local domain name and adapters? Pin
yitzhak24-Jul-03 0:14
yitzhak24-Jul-03 0:14 
GeneralRe: Local domain name and adapters? Pin
Dominik Reichl24-Jul-03 0:45
Dominik Reichl24-Jul-03 0:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.