Go Back   Velocity Reviews > Newsgroups > VHDL
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

VHDL - Data error

 
Thread Tools Search this Thread
Old 01-17-2006, 03:37 PM   #1
Default Data error


Hi,
I interfaced a USB 8 bit data bus with a CPLD. I made a 48 bit buffer (
ser_buff ). I am loading the buffer at each falling edge of the USB
clock. and then copying it into another 48 bit buffer ( Temp ) and the
serially ouputting the Temp buffer in another process running on
different clock. "inc" signal acts as a trigger signal to the other
process to start parallel to serial conversion.

The problem is that I am not seeing the right data coming out of the
CPLD ( ser_out) port. If kept the USB data to zero but at the ser_out,
I can still see some ones. Please adivce soon.
My code is given below

Thanks
John
Process (State)

Begin

Data_clk <= DPR_CLK;
ser_clk<= count_A(0);
second_clock<= count_A(0);


Case State is

When G0=>
ser_buff ( 7 downto 0) <= USB_Data ( 7 downto 0 );
inc<='0';
Latch_ser_buff <='0';
nextstate <=G1;

When G1 =>
ser_buff ( 15 downto <= USB_Data ( 7 downto 0 );
inc <='0';
Latch_ser_buff <='0';

nextstate <=G2;

When G2 =>
ser_buff ( 23 downto 16)<= USB_Data ( 7 downto 0 );
inc<='0';
Latch_ser_buff<='0';

nextstate <=G3;

When G3 =>
ser_buff ( 31 downto 24)<= USB_Data ( 7 downto 0 );
inc <='0';
Latch_ser_buff <='0';

nextstate <=G4;

When G4 =>
ser_buff ( 39 downto 32)<= USB_Data ( 7 downto 0 );
Latch_ser_buff <='0';
inc <='0';

nextstate <=G5;

When G5 =>
ser_buff ( 47 downto 40)<= USB_Data ( 7 downto 0 );
Latch_ser_buff <='0';
inc <='0';

nextstate <=G6;

When G6 =>

Latch_ser_buff <='1';
inc <='0';

nextstate <=G7;

When G7 =>

Latch_ser_buff <='0';
inc <='1';

nextstate <=G7;

When others =>

nextstate <=G0;

End case;
End Process;


Process (USB_CLK, Reset_USB )
Begin

If( Reset_USB = '1' OR Second_DPR_Reset = '1') Then

LED_RESET_USB <= '1';
State <= G0;


Else If( USB_CLK 'Event And USB_CLK = '0') Then


LED_RESET_USB <= '0';
State <= nextstate;
End If;
End If;


If( USB_CLK 'Event And USB_CLK = '0' ) Then

If (Latch_ser_buff = '0' ) Then

Temp <= (others => '0');

Else If (Latch_ser_buff= '1' ) Then

Temp<= ser_buff;

End If;
End If;

End If;
End Process;

Process ( DPR_CLK, Reset_DPR, inc )
Begin

If( Reset_DPR = '1' OR Second_DPR_Reset = '1')Then

LED_RESET_DPR<='1';
Tag<='1';
P2S_counter<="000000";
--count_A <= "00000";

Else If (DPR_CLK 'event And DPR_CLK='1')Then

If ( inc='1' And P2S_counter /= "110000")Then

Tag <='0';
LED_RESET_DPR <='0';
P2S_counter <=P2S_counter + 1;
ser_out <= Temp ( to_integer( P2S_counter ) ) ;
Else

End If;
End If;
End If;

If (DPR_CLK 'eventAnd DPR_CLK = '1' ) Then

If ( P2S_counter ="110000" ) Then

Second_DPR_Reset<= '1';

Else
Second_DPR_Reset<= '0';
End If;
End If;

If ( DPR_CLK 'event And DPR_CLK='1' ) Then

count_A<= count_A + 1;
End If;
End Process;
End DPR_ARCH;



john
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Wonderful data input with web reporting tool freezea Software 0 09-09-2009 05:30 AM
Getting File error: data may have been lost - pyExcelerator related Amudha Software 0 08-26-2008 07:16 AM
Need help on Modelsim VHDL syntax? ASAP:) kaji General Help Related Topics 0 03-14-2007 10:43 PM
Need help on a Modelsim VHDL Syntax? ASAP:) kaji Software 0 03-14-2007 10:43 PM
Need Help on a Modelsim VHDL Syntax....ASAP:) kaji Hardware 0 03-14-2007 10:41 PM




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

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