Hello i want send data NMEA from GPS to FPGA and from FPGA to PC, i'm using UART vhdl with 38400 baudrate. i test uart with send n receive data, if i send data one alphabet example "a" or one number example "8" uart is work, but if i send data nmea from GPS like "$GPVTG,054.7,T,034.4,M,005.5,N,010.2,K*48" i cant receive it in my PC. any help me please. Thanks a lot.
Yuniarto Wimbo N. wrote: > Hello i want send data NMEA from GPS to FPGA and from FPGA to PC, i'm > using UART vhdl with 38400 baudrate. Why the FPGA? I would connect the GPS directly to the PC... > i test uart Which one? > i test uart with send n receive data, if i send data one alphabet > example "a" or one number example "8" uart is work How did you find that out? And how did you test it? Did you test this uart an a testbench in a simulator? > but if i send data nmea from GPS like > "$GPVTG,054.7,T,034.4,M,005.5,N,010.2,K*48" i cant receive it in my PC. This somehow curios design seems to be extremely simple to me. In VHDL it will be somewhat like that:
1 | |
2 | |
> any help me please.
Without knowing anything about your desgin, even not seeing one line of
HDL, how should anyone be able to help?
Guest
#4452407
so a single character works, but a sequence of characters is not received? Does "not received" mean, that you get no data at all or do you receive scrambled data? Maybe you send the individual characters of your NMEA-string too close to each other, so that there's not enough time for a stop-bit inbetween. Take a look to the bit-sequence with an oscilloscope and decode the first 2-3 characters manually, that may tell you what you have to fix.
>Why the FPGA? I would connect the GPS directly to the PC... -because i want made autopilot system using FPGA >How did you find that out? >And how did you test it? >Did you test this uart an a testbench in a simulator? - i find result di my pc - i test fpga to pc using this is my uart
1 | |
2 | |
3 | |
4 | |
5 | |
6 | |
7 | |
8 | |
9 | |
10 | |
11 | |
12 | |
13 | |
14 | |
15 | |
16 | |
17 | |
18 | |
19 | |
20 | |
21 | |
22 | |
23 | |
24 | |
25 | |
26 | |
27 | |
28 | |
29 | |
30 | |
31 | |
32 | |
33 | |
34 | |
35 | |
36 | |
37 | |
38 | |
39 | |
40 | |
41 | |
42 | |
43 | |
44 | |
45 | |
46 | |
47 | |
48 | |
49 | |
50 | |
51 | |
52 | |
53 | |
54 | |
55 | |
56 | |
57 | |
58 | |
59 | |
60 | |
61 | |
62 | |
63 | |
64 | |
65 | |
66 | |
67 | |
68 | |
69 | |
70 | |
71 | |
72 | |
73 | |
74 | |
75 | |
76 | |
77 | |
78 | |
79 | |
80 | |
81 | |
82 | |
83 | |
84 | |
85 | |
86 | |
87 | |
88 | |
89 | |
90 | |
91 | |
92 | |
93 | |
94 | |
95 | |
96 | |
97 | |
98 | |
99 | |
100 | |
>so a single character works, but a sequence of characters is not >received? Does "not received" mean, that you get no data at all or do >you receive scrambled data? >Maybe you send the individual characters of your NMEA-string too close >to each other, so that there's not enough time for a stop-bit inbetween. >Take a look to the bit-sequence with an oscilloscope and decode the >first 2-3 characters manually, that may tell you what you have to fix. yes you true, i have receive scramble data, and data not constants per second
Guest
#4452458
ok, some problems to start with: - you use a logic signal (clk9600) as a clock. Don't do that. Take the real clock clk instead to toggle your registers and use a Clock-Enable to define the baudrate. - for your transmitter I see a shift-register, but I do not yet see a UART yet. E.g. your code will only give you a correct sequence when the signal "go" is 1 for exactly 10 bittimes. How is the signal "go" controlled? If if toggles back to 0 to early, the remaining bits are skipped. If it toggles to 0 to late, the transmission is restarted. - in your receiver you use a latch to store incoming data. Don't do that: work with registers. Furthermore the moment, when you finally store the data to buff, is not fixed to the middle of the bit-time. The clk9600 of the receiver must somehow be synchronized to the begin of the startbit.
Yuniarto Wimbo N. wrote: > this is my uart 1. See the screenshot. 2. Read it and understand it. 2. Do it. There are too much signals in the sensitivity list: > process(clk9600,go,p_in) clk9600 would be enough. But: clk9600 ist NOT a clock, is is just a simple clock enable... > i have receive scramble data, and data not constants per second As I saw that code my first thought was: Ouch! You MUST implement a test bench an check your design on that test bench. Then you can see that whole bunch of tricky race conditions in your code. One is e.g. the sampling point of the incoming RS232 signal. At the last link there you can find a test bench: http://www.lothar-miller.de/s9y/archives/60-RS232-IO.html#extended And also look there: http://www.lothar-miller.de/s9y/categories/42-RS232 (Try Google translator, its German...)
>Achim S. (Guest)
(clk9600) is just name only not value baudrate. :D
thanks a lot for your guide, ok i want correct my programming again.
:D
> Lothar Miller
i'm sorry about my post :) please forgive me about it.
ok i'll implement uart vhdl programming in testbench.
Yuniarto Wimbo N. wrote: > (clk9600) is just name only But you use it as a clock, because everything using a 'event or a rising_edge() or a falling_edge() is a clock... :-o Some simple rules for beginners: - only 1 clock in the whole design (thats usually around 10..100MHz) - external signals must be synced to that clock before using them - no variables, or at the very least no memorizing variables - no latches (read the synthesizers warnings!)
Reply
Please log in before posting.
