L
laststep
Guest
J'utilise le conseil apex altera de développer un robot autonome en utilisant un dispositif Bluetooth.
J'ai créer un code UART pour transmettre et recevoir à partir de Bluetooth.Mon recevoir une partie est ok cause il peut lire correctement le i clés ont appuyez sur le côté PC.Le problème est lorsque je transmets la chaîne à la PC, certains caractères sont corrompus, mais parfois il peut Diplay toute la chaîne correctement.
Ci-dessous est ma transmettre le codage peuvent some1 rappeler quel est le problème avec cette simple transmission de codage.
merci
commencer
(processus de réinitialisation, clkin, Y) commencent
if (reset = '1 ') then
y <= s0;
TxD <= '1 ';
TranComplete <= '0 ';
elsif (clkin'event et clkin = '1 ') then
cas y est
quand S0 => si RR = '1 'alors
y <= s1;
DATAIN <= entrée;
else y <= s0;
End If;
lorsque S1 => TxD <= '0 ';
y <= s2;
lorsque S2 => TxD <= DATAIN (0);
y <= S3;
quand s3 => TxD <= DATAIN (1);
y <= S4;
quand s4 => TxD <= DATAIN (2);
y <= S5;
quand s5 => TxD <= DATAIN (3);
y <= S6;
quand s6 => TxD <= DATAIN (4);
y <= S7;
quand S7 => TxD <= DATAIN (5);
y <= S8;
quand s8 => TxD <= DATAIN (6);
y <= s9;
quand s9 => TxD <= DATAIN (7);
y <= S10;
quand s10 => TxD <= '1 ';
y <= S11;
quand s11 => y <= s12;
quand S12 => y <= s13;
quand S13 => y <= S14;
quand S14 => y <= s15;
quand s15 => y <= s16;
TranComplete <= '1 ';
quand s16 => y <= s0;
TranComplete <= '0 ';
when others => y <= s0;
Fin de cas;
End If;
Terminer le processus;
J'ai créer un code UART pour transmettre et recevoir à partir de Bluetooth.Mon recevoir une partie est ok cause il peut lire correctement le i clés ont appuyez sur le côté PC.Le problème est lorsque je transmets la chaîne à la PC, certains caractères sont corrompus, mais parfois il peut Diplay toute la chaîne correctement.
Ci-dessous est ma transmettre le codage peuvent some1 rappeler quel est le problème avec cette simple transmission de codage.
merci
commencer
(processus de réinitialisation, clkin, Y) commencent
if (reset = '1 ') then
y <= s0;
TxD <= '1 ';
TranComplete <= '0 ';
elsif (clkin'event et clkin = '1 ') then
cas y est
quand S0 => si RR = '1 'alors
y <= s1;
DATAIN <= entrée;
else y <= s0;
End If;
lorsque S1 => TxD <= '0 ';
y <= s2;
lorsque S2 => TxD <= DATAIN (0);
y <= S3;
quand s3 => TxD <= DATAIN (1);
y <= S4;
quand s4 => TxD <= DATAIN (2);
y <= S5;
quand s5 => TxD <= DATAIN (3);
y <= S6;
quand s6 => TxD <= DATAIN (4);
y <= S7;
quand S7 => TxD <= DATAIN (5);
y <= S8;
quand s8 => TxD <= DATAIN (6);
y <= s9;
quand s9 => TxD <= DATAIN (7);
y <= S10;
quand s10 => TxD <= '1 ';
y <= S11;
quand s11 => y <= s12;
quand S12 => y <= s13;
quand S13 => y <= S14;
quand S14 => y <= s15;
quand s15 => y <= s16;
TranComplete <= '1 ';
quand s16 => y <= s0;
TranComplete <= '0 ';
when others => y <= s0;
Fin de cas;
End If;
Terminer le processus;