> You are using the generic controls for Win32. You are going to need to > change the DCE control for windows and write your own drivers. Windows ??? generic controls, own drivers ??? > assumes that the serial RXD and TXD will be in ASCII and not in > binary. To get binary you have to change the ASCII setting to a BINARY > setting in teh DCE and then create a RAW rxd and txd routine to allow ??? DCE RAW rxd txd routine ??? > you to get the characters. You can probably use an ActiveX control to > help you do this so you do not have to reinvent the wheel. If you need > some ideas I can email you a link of some source code that was written > for a serial DLL that we give away to customers. Have you ever programmed Win32? The code below is essentially correct, CreateFile() and ReadFile() are perfectly usable. The only thing missing is setting up the port itself. Use SetCommState() for that. For more reference information see: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/devio/base/ communications_functions.asp Eric > --- In lpc2000@yahoogroups.com, "soren_t_hansen" <soren_t_hansen@y...> > wrote: > > I use a Win32 comport to receive with. It has the following setup: > > > > HANDLE m_hCom = 0; > > m_hCom = CreateFile(m_sComPort, // pointer to name of the file > > GENERIC_READ | GENERIC_WRITE, > > 0, > > NULL, > > OPEN_EXISTING, > > FILE_FLAG_NO_BUFFERING, > > NULL); > > > > I then read the comport with the following call: > > > > ReadFile(m_hCom, buffer, length, &iBytesRead, NULL); > > > > How can I prevent the PC from stripping the 0s? > > > > Søren > > > > --- In lpc2000@yahoogroups.com, Peter Jakacki <peterjak@t...> wrote: > > > Oh, you can transmit a 0 ok, it's just that the PC may strip NULs > (0's) > > > from the input stream. It just comes back down to what software > you are > > > using to receive. But since I don't know what you are > using I can't > > help. :) > > > > > > BTW, try transmiting 0's from the PC back to the PC to > test that end. > > > Elimination is the 1st part of debugging. > > > > > > *Peter* > > > > > > soren_t_hansen wrote: > > > > > > >Hi everybody > > > > > > > >I want to transmit a number og bytes on UART1 and some > of them are 0. > > > >When I receive the bytes on the PC, all the 0s are gone, > resulting in > > > >an error on that side. > > > > > > > >I use the following to transmit the bytes: > > > > > > > >while (!(U1LSR & 0x20)); > > > > U1THR = buffer[i]; > > > > > > > >Isn't possible to transmit a 0? > > > > > > > >Best Regards > > > >Søren > > > > > > > > > > Yahoo! Groups Links > > > > > >
Message
RE: [lpc2000] Re: Problems with UART1 on LPC2132
2005-06-20 by Eric Rullens
Attachments
- No local attachments were found for this message.