Test COM port LED custmer display using windows cmd - windows

I buy customer display that customer display has PL-2303HXD chip. The customer display connect to COM1 to my PC.I can send any number using test software come with that customer display. but I can't display any value using cmd in windows.
In the manual ask to try
C: \> MODE COM1 2400, N, 8,1
C: \> TYPE CON> COM1
in cmd but that not work for me. please tell how can i test customer display using cmd in windows.
Instructions for application:
Use the standard RS232 serial port (baud rate= 2400, parity =none, data bits = 8, stop
bit = 1).
Use international ESC / POS Common set of commands, do not need to install any drivers. Both under DOS or WINDOWS platform, just follow the format of the commandset to send data to the serial port to display the content, without handshake.

Related

How to get the serial port number in Makefile?

Sometimes, you need to know the serial port number when developing MCUs. For example, I plug the USB cable of the board into the USB port of my computer, then one serial port number appeared in the Device Manager, such as COM6. Then I can use the programmer to upload my program (.elf or .hex) to the MCU, the premise is that I specify the serial port number, namely, the 6 in COM6, to the programmer through the command.
For example, in command prompt of CMD.exe, I use "dwdebug.exe com6,l
test.elf,qr" to flash the MCU, the dwdebug.exe is the executable program which used for programming, the com6 is the serial port number, and test.elf is the code to be flashed into the MCU, l means "load", qr means "quit dwdebug.exe after loading, and run mcu".
In addition, I can use the command "dwdebug.exe ls,q" to list all the serial port number available in CMD.exe, for example, after running dwdebug.exe ls,q in CMD.exe, the outputs displayed in the CMD window:
COM5 .Expecting break byte 0x00, but no bytes read.
ATmega328P on COM6 at 62537 baud.
Then I planed to write a Makefile, part of the Makefile is:
COM = 6
PRG = test
MCU_TARGET = atmega328p
CLK = 8000000UL
UPLOADER = dwdebug
flash:
dwdebug ls,q
$(UPLOADER) device com$(COM),l $(PRG).elf,qr
debug:
$(UPLOADER) device com$(COM),l $(PRG).elf
From the Makefile above we can see that the variable COM at the beginning of the Makefile must assigned by the user, the serial port number, namely, the value of COM, is used by dwdebug.exe for flashing and debugging.
So, I think it's better to extract the number "6" behind "ATmega328P on COM", and assigned it to the variable COM:
flash:
dwdebug ls,q
$(UPLOADER) device com$(COM),l $(PRG).elf,qr
debug:
$(UPLOADER) device com$(COM),l $(PRG).elf
The advantage of doing this is that the user no longer need to view the Device Manager, namely, the user will not assign the serial port number (the 6) to COM at the beginning of the Makefile too, let the code finish the work automatically.
After searching many web pages, now I can save the outputs of "dwdebug ls,q" in a .txt file, such as:
flash:
dwdebug ls,q > serial.txt
$(UPLOADER) device com$(COM),l $(PRG).elf,qr
Now, the content of serial.txt is:
COM5 .Expecting break byte 0x00, but no bytes read.
COM6 ................
ATmega328P on COM6 at 61934 baud.
But how to extract the number "6" behind "ATmega328P on COM", and use the "6" in Makefile as the value of variable COM? It is a difficult point that I cannot be overcome, is there anyway to overcome this problem?
Best regards.
P.S.1 "ATmega328P on COM" is not changed.
P.S.2 My OS is Windows 10
Extract the serial port number, and assigned it to a variable in Makefile.

Concurrent DOS + QEMU losing data through parallel port emulation

I have a piece of software running on concurrent DOS 3.1, which I emulate with QEMU 5.1.
In this program, there are several options to print data. The problem is that the data arriving to my host does not correspond to the data sent.
the command to start qemu:
qemu-system-i386 -chardev file,id=imp0,path=/path/to/file -parallel chardev:imp0 -hda DISK.Raw
So the output sent on parallel port of my guest is redirected to /path/to/file.
When I send the charactère 'é' from CDOS:
echo é>>PRN
The code page used on CDOS is Code Page 437, and in this charactere set, the charactère é is represented by 0x82, but on my host, instead, I receive the following:
cp437 é -> 0x82 ---------> host -> x1b52 x017b x1b52 x00
So I tried something else. I wrote the charactère 'é' in a file, and sent the file with nc.exe (from brutman and libmtcp), and with nc, the value stays 0x82.
So my question, what happen when I send my data to virtual parallel port? When does my data get transformed? Is it the parallel port on Concurrent DOS? Is it the QEMU? I can't figure out how to send my data through LPT1 properly.
I also tried this:
qemu-system-i386 -chardev socket,id=imp0,host=127.0.0.1,port=2222,server,nowait -parallel chardev:imp0 -hda DISK.Raw
I can read the socket fine, but same output as when I write in a file, the é get transformed to x1b52 x017b x1b52 x00.
The byte sequence "1B 52 01 7B 1B 52 00" is using Epson FX-style printer escape sequences (there's a reference here). Specifically, "1B 52 nn" is ESC R n which selects the international character set, where character set 0 is USA and 1 is France. So the sequence as a whole is "Select French character set; print byte 0x7b; select US character set". In the French character set for this printer standard, 0x7B is the e-acute é.
This is almost certainly the CDOS printer driver assuming that the thing on the end of PRN: is an Epson printer and emitting the appropriate escape sequences to output your text on that kind of printer.
OK, so i finally figured it out... After hours of searching where this printer.sys driver could be, or how to remove it, no Concurrent DOS, the setup command is "n". And of course, it is not listed in the "help" command...
Anyway, in there you can setup your printer, and select "no conversion" for the port you want. And it was actually on Epson MX-80/MX-100.
So thanks to Peter's answer, you led me to the right path !

Transmit commands in ASCII format STM32

I'm using STM32 discovery board to communicate to a device that takes ASCII commands.
I use HAL_UART_TRANSMIT_IT to send data, that works fine.
I want to send ASCII command XM3 to the device. When I use virtual port programs as realterm, I just click on ascii and put the baudrate, databitc etc etc and when I type in XM3 and click on +CR it send the command and it works fine, if CR is not included it doesent work.
When I try to do that from my MCU I use this code and it does not work, any ideas how to send ASCII commands in C via serial port?
char txD[3]="XM3";
__HAL_UART_ENABLE_IT(&huart1, UART_IT_TC);
HAL_UART_Transmit_IT(&huart1, (uint8_t *)txD ,3);
When I send this to realterm it shows XM3 but when I send this to the device nothing happens.
I need to know how I send XM3 and a CR to the device.
If you send the command via Realterm and check the +CR option, Realterm does append a Carriage Return, i.e. ASCII Code 13.
In order to reproduce this behavior in your code, you should define the command as follows:
char txD[4]="XM3\r";
Respectively, if the receiver also expects to receive a Newline, i.e. ASCII Code 10, you should define it as follows:
char txD[5]="XM3\r\n";

Spartan 3ADSP device DNA read via JTAG

how to read device DNA for Spartan 3A DSP via JTAG cable using iMPACT tool ? and if any other methods available to cross check the code readead deviceDNA value, whether it is correct deviceDNA value of that device OR not?
There is a Xilinx AR for this:
AR# 40856 iMPACT- How can I read DNA from my FPGA with IMPACT?
For Spartan-3A series devices (Spartan-3A, Spartan-3AN
andSpartan-3ANDSP)
To read if the DNA iMPACT batch mode command is available. ("readDna -p <position>") How to get the Xilinx Device DNA via iMPACT
batch mode?
1. Generate iMPACT batch mode file say ".cmd" (in any ASCII text Editor) with following text commands in it. You can run this in
iMPACT batch mode. In the commands below, "X" denotes the position of
the targeted device.
setMode -bs
setCable -port auto
Identify
identifyMPM
Readdna -p X
exit
2.Run above generated file "readDNA.cmd" (ASCII text file) in IMPACT batch mode command line as:
Impact -batch <filename>.cmd
The above command will display the DNA number on the DOS command console.
Note: If FPGA is configured prior to read Device DNA via JTAG port then the value will be wrong. Please make sure that FPGA is not
configured from external Flash or JTAG device. To achieve this simply
change mode pins or erase the external Flash deviceand powercycle the
board.

Serial Port Data Structure

I need to send data to a hardware device over serial port. I'm using a program called serial port tool for os x.
After I connect to the device there is a form box where I can type data to send. I have no idea how to format the data.
Here is an excerpt from the manual for the device.
"The Net Manager Command structure consists of one start byte, one command byte, five bytes of data, and a one byte checksum. Each message packet is formatted as follows:"
an example command is:
Byte0=30 Byte1=7 Byte2=5 Byte3=1 Byte4=2 Byte5=0 Byte6=245
How do I type that into the form box in serial port tool?
Thanks,
Seth
Does the "serial port tool" you're using come with any documentation?
Assuming the "form box" is expecting printable characters, what you're looking for is a way to input an arbitrary byte value. For example, there might be a mechanism that lets you use an octal or hexadecimal escape sequence (such as \036 or \24).

Resources