Go to previous topic
Go to next topic
Last Post 07 Nov 2005 05:02 PM by  Anonymous
Communicate with Serial Port with LH7A404
 3 Replies
Author Messages
schung
New Member
New Member
Posts:


--
07 Nov 2005 11:08 AM
    I am wondering if I can dowload a sample code that talks to the serial code using LH7A404?

    The LH7A401 sample application shows how to output characters to PC via TeraTerm, I am looking for something similar but for LH7A404.

    Thanks!
    rmysjr@hotmail.com
    New Member
    New Member
    Posts:


    --
    07 Nov 2005 11:37 AM
    hPort = CreateFile (TEXT("COM1:"), GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL);

    WriteFile (hPort, szSend, strlen(szSend), &dwWriten, 0); // send to serial. pay attention into what you want to send.
    // if the data has a null in the middle, you cannot use strlen to return the length.
    ReadFile (hPort, &szCommBuffer, 10, &dwRead, NULL); // read 10 bytes from

    CloseHandle (hPort);


    Is that what you need?
    schung
    New Member
    New Member
    Posts:


    --
    07 Nov 2005 04:32 PM
    No it is not. I am looking for a strict TeraTerm printf module/ command.

    I guess what I really need is a serial.c/serial.h that knows how to talk to the 404 and a compiler to compile serial.* into my console programs.
    Anonymous
    Posts:


    --
    07 Nov 2005 05:02 PM
    Hello,

    You should be able to modify the code that you for the 75401 if by looking in the LH7A404 User Manual and find the UART's data register address.

    Thanks,


    ---