Does anyone know how I can write to the COM port on the 8051? I know how to do so in Visual C++ but I'm not sure if its the same way. In Visual C++, I would use the following code: HANDLE hSerial; BOOL w_ret; DWORD write = 19; char buf[20] = {0}; hSerial = CreateFile("COM1",GENERIC_READ | GENERIC_WRITE,0,0,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,0); COMMTIMEOUTS cto = {MAXDWORD, 0, 0, 0, 0 }; w_ret = WriteFile(hSerial,buf,write,&write,NULL); Thanks!
Thanks....where can I find that sample?
"Thanks....where can I find that sample?" If you need to ask, then you need to start with the uVision Getting Started guide - it'll be in the uVision 'Books' tab, or see the 'Help' menu.
In The sample folder where you installed Keil. 1 - the 8052 and windows programming are different. None of the windows APIs will work. In general Windows APIs are unique to windows. 2 - C and C++ are not the same languge 3 - the 8052 has very limit RAM and ROM Take care or run out.