A set of additional non-official demo projects for QmTech
Cyclone IV
Core Board
(EP4CE15F23C8
).
For testing RS232
QuickRS232
module
was designed project SerialPortEcho
. This project receive bytes from serial port (COM
) that is configured in following mode - 115200 bit/s, 1 stop bit, even parity, no flow control
. This project do following: receive byte, add + 1 and send it back
.
You could use our application Zerial
to work with RS232
:
CLK
- global clock - already on the board -> DIFFCLK_1P
(T2
)RX
- RS232
RX
line - connected to U8
20 pin
-> IO_AB19
TX
- RS232
TX
line - connected to U8
22 pin
-> IO_AB20
RTS
- we don’t USE it in this demo because simple TTL
to RS232
converter, but anyway we connect it to U8
24 pin
-> IO_Y21
CTS
- we don’t USE it in this demo because simple TTL
to RS232
converter,
but anyway we connect it to U8
26 pin
-> IO_W21
RX_LED
- connect it to D5 LED
-> DIFFIO_L2P
(E4
)TX_LED
- don’t have on board free LED
, therefore just out it to pin 30 of U8
(IO_U21
)Additionally RS232-to-TTL converter must be attached to power supply line and ground, that also could be taken from U8
:
3V3
- Any pin from (3, 4)GND
- Any pin from (1, 2, 61, 62)Usually we don’t work with separate bytes, we are interacting with device by commands, device is answering on received command, therefore we wrapped bytes in Command/Answer
via frames.
In this demo Frame have a following format of a Frame :
SOF | Space | Payload Len | Payload |EOF
, where:
SOF
- start of a frame (2 bytes of 0xFF
)Space
- separator (0 Byte - 0x00
)Payload len
- number of payload bytesPayload
- actual payload, could be up to 255, but in demo restricted to 8EOF
- end of a frame (2 bytes of EE
)In this demo (SerialPortWithCmdProcessor
folder/project) we are having following 2 commands:
0xFF 0xFF 0x00 0x07 0x01 0x02 0x10 0x20 0x30 0x40 0xEE 0xEE
which means SET
(cmd code 0x01
, 0 byte of payload) Register 0x02
(index of registers 0-7
, 1 byte of payload) to value 0x10203040
.0x02
), i.e. reading of register of index 0x03
:
0xFF 0xFF 0x00 0x02 0x02 0x03 0xEE 0xEE
Example of how decoder works, we haven’t yet encoder (maybe will be in future)
Example of interacting with device by Commands/Answers
CLK
- global clock - already on the board -> DIFFCLK_1P
(T2
)RX
- RS232
RX
line - connected to U8
20 pin
-> IO_AB19
TX
- RS232
TX
line - connected to U8
22 pin
-> IO_AB20
RTS
- we don’t USE it in this demo because simple TTL
to RS232
converter, but anyway we connect it to U8
24 pin
-> IO_Y21
CTS
- we don’t USE it in this demo because simple TTL
to RS232
converter,
but anyway we connect it to U8
26 pin
-> IO_W21
RX_LED
- connect it to D5 LED
-> DIFFIO_L2P
(E4
)TX_LED
- don’t have on board free LED
, therefore just out it to pin 30 of U8
(IO_U21
)Additionally RS232-to-TTL converter must be attached to power supply line and ground, that also could be taken from U8
:
3V3
- Any pin from (3, 4)GND
- Any pin from (1, 2, 61, 62)is under development….
Give us a STAR for motivating us to do this (100 stars min to prioritize this work)