Skip to content

Commit 3a15e43

Browse files
committed
docs were updated
1 parent 52ff694 commit 3a15e43

File tree

2 files changed

+45
-4
lines changed

2 files changed

+45
-4
lines changed

README.md

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,52 @@ Additionally RS232-to-TTL converter must be attached to power supply line and gr
3939

4040
### 2.2 Cmd Decode+Encode RS232 Demo
4141

42-
is under development....
42+
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***.
43+
44+
In this demo Frame have a following **format of a Frame** :
45+
`SOF | Space | Payload Len | Payload |EOF ` , where:
46+
* `SOF` - start of a frame (2 bytes of `0xFF`)
47+
* `Space` - separator (0 Byte - `0x00`)
48+
* `Payload len` - number of payload bytes
49+
* `Payload` - actual payload, *could be up to 255*, but in demo **restricted to 8**
50+
* `EOF` - end of a frame (2 bytes of `EE`)
51+
52+
In this demo (`SerialPortWithCmdProcessor` folder/project) we are having following 2 commands:
53+
1. *Set 4-byte register* - `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`.
54+
2. *Get 4-byte register* - (cmd code `0x02`), i.e. reading of register of index `0x03` :
55+
`0xFF 0xFF 0x00 0x02 0x02 0x03 0xEE 0xEE`
56+
57+
#### 2.2.1 Testbenches diagrams demonstrating how it works:
58+
59+
Example of how decoder works, we haven't yet encoder (maybe will be in future)
60+
61+
![Frame parser/decoder](/docs/img/serial_cmd_decoder_example.png)
62+
63+
Example of interacting with device by `Commands/Answers`
64+
65+
![Interaction by commands](/docs/img/cmd_commands_demo.png)
66+
67+
#### 2.2.2 Demo project on board pinout
68+
69+
* `CLK` - global clock - already on the board -> `DIFFCLK_1P` (`T2`)
70+
* `RX` - `RS232` `RX` line - connected to `U8` `20 pin` -> `IO_AB19`
71+
* `TX` - `RS232` `TX` line - connected to `U8` `22 pin` -> `IO_AB20`
72+
* `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`
73+
* `CTS` - we don't USE it in this demo because simple `TTL` to `RS232` converter,
74+
but anyway we connect it to `U8` `26 pin` -> `IO_W21`
75+
* `RX_LED` - connect it to `D5 LED` -> `DIFFIO_L2P` (`E4`)
76+
* `TX_LED` - don't have on board free `LED`, therefore just out it to pin 30 of `U8` (`IO_U21`)
77+
78+
Additionally RS232-to-TTL converter must be attached to power supply line and ground, that also could be taken from `U8`:
79+
80+
* `3V3` - Any pin from (3, 4)
81+
* `GND` - Any pin from (1, 2, 61, 62)
4382

4483
### 2.3 DRAM Explorer + RS232 Demo
4584

4685
is under development....
4786

87+
Give us a STAR for motivating us to do this (**100 stars min to prioritize this work**)
88+
4889

4990

SerialPortWithCmdProcessor/serial_cmd_processor.qsf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ set_global_assignment -name VERILOG_FILE serial_cmd_processor.v
6161
set_global_assignment -name VERILOG_FILE serial_cmd_decoder.v
6262
set_global_assignment -name VERILOG_FILE serial_cmd_decoder_tb.v
6363
set_global_assignment -name EDA_TEST_BENCH_ENABLE_STATUS TEST_BENCH_MODE -section_id eda_simulation
64-
set_global_assignment -name EDA_NATIVELINK_SIMULATION_TEST_BENCH serial_cmd_decoder_tb -section_id eda_simulation
64+
set_global_assignment -name EDA_NATIVELINK_SIMULATION_TEST_BENCH serial_cmd_processor_tb -section_id eda_simulation
6565
set_global_assignment -name EDA_TEST_BENCH_NAME serial_cmd_decoder_tb -section_id eda_simulation
6666
set_global_assignment -name EDA_DESIGN_INSTANCE_NAME NA -section_id serial_cmd_decoder_tb
6767
set_global_assignment -name EDA_TEST_BENCH_MODULE_NAME serial_cmd_decoder_tb -section_id serial_cmd_decoder_tb
@@ -100,8 +100,8 @@ set_global_assignment -name VERILOG_FILE serial_cmd_processor_tb.v
100100
set_global_assignment -name EDA_TEST_BENCH_NAME serial_cmd_processor_tb -section_id eda_simulation
101101
set_global_assignment -name EDA_DESIGN_INSTANCE_NAME NA -section_id serial_cmd_processor_tb
102102
set_global_assignment -name EDA_TEST_BENCH_MODULE_NAME serial_cmd_processor_tb -section_id serial_cmd_processor_tb
103+
set_instance_assignment -name PARTITION_HIERARCHY root_partition -to | -section_id Top
103104
set_global_assignment -name EDA_TEST_BENCH_FILE serial_cmd_decoder_tb.v -section_id serial_cmd_decoder_tb
104105
set_global_assignment -name EDA_TEST_BENCH_FILE serial_cmd_decoder.v -section_id serial_cmd_decoder_tb
105106
set_global_assignment -name EDA_TEST_BENCH_FILE serial_cmd_processor_tb.v -section_id serial_cmd_processor_tb
106-
set_global_assignment -name EDA_TEST_BENCH_FILE serial_cmd_processor.v -section_id serial_cmd_processor_tb
107-
set_instance_assignment -name PARTITION_HIERARCHY root_partition -to | -section_id Top
107+
set_global_assignment -name EDA_TEST_BENCH_FILE serial_cmd_processor.v -section_id serial_cmd_processor_tb

0 commit comments

Comments
 (0)