cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Observer
Observer
7,409 Views
Registered: ‎04-19-2013

uart transmission problem

Hello friends, 

 

I am writing a uart code for transmission in verilog. I want to transmit 64bits of data from a simple adder program. However i can transmit only 11 bits. Why am i unable to transmit all 64bits of data?

 

Thanks in advance.

0 Kudos
Reply
11 Replies
Teacher
Teacher
7,403 Views
Registered: ‎08-14-2007

Hi,

just a guess:

Your first bit is stuck at 0 and the last one is stuck at 1, isn't it?

 

(Startbit, 8 databits, paritybit, stopbit = 11 bits, strange coincidence)

 

Some more details would be helpful.

Have you done some simulations?

 

Have a nice synthesis

  Eilert

0 Kudos
Reply
Observer
Observer
7,395 Views
Registered: ‎04-19-2013

Hi,

 

Thank you for your quick reply. I have attached the simulation image. Initially I am trying for 16 bits as shown in example. Please let me know where am i going wrong?

 

Thanks in advance.

Untitled.jpg
0 Kudos
Reply
Historian
Historian
7,379 Views
Registered: ‎02-25-2008


@sumimandal085 wrote:

Hi,

 

Thank you for your quick reply. I have attached the simulation image. Initially I am trying for 16 bits as shown in example. Please let me know where am i going wrong?

 

Thanks in advance.


The image is too small to be of use, but without knowing the details, I'll guess that you're not waiting for each byte to be shifted out before loading the next byte into the transmitter.

----------------------------Yes, I do this for a living.
0 Kudos
Reply
Teacher
Teacher
7,376 Views
Registered: ‎08-14-2007

Hi,

you should properly initialize your testbench, so you hjave no 'U' signals in the beginning.

Maybe using the reset input would be a good idea.

Pulling the Load input low some time might be useful too.

 

Then there's this CS counting Vector. (or is it a state vector(CS=Current state)

It's conting decadic and not even going back to zero.

So how should there come out more than the standard 8N1 formatted UART bits.

 

Maybe you should try to understand the UART code better that you are going to adapt to your needs.

Do you know how a FSM works?

 

Have a nice synthesis

   Eilert

0 Kudos
Reply
Teacher
Teacher
7,375 Views
Registered: ‎08-14-2007

Hi,

just another question:

Do you want to create a 16 (or later64) bit UART,

or do you wan't to transmit N Bytes (N=2 to 8) of data with a standard UART?

 

I just recognized the "select" signal.

Should you use this for selecting one of N input bytes from your dataword?

 

Have a nice synthesis

  Eilert

0 Kudos
Reply
Observer
Observer
7,368 Views
Registered: ‎04-19-2013

I want to transmit 160 bits, so i am trying for 8 then 16 and later 64,96,128,160.
0 Kudos
Reply
Teacher
Teacher
7,357 Views
Registered: ‎08-14-2007

Hi,

you didn't understand the point of the question.

 

Do you want to transmit 2^n Bits  in one (big) frame?

   or

Do you want to transmit m Bytes in m 8-Bit Frames?

  (Keep in mid that 160 Bits are eqal to 20 Bytes.)

 

Two totally different approaches!

 

Have a nice synthesis

  Eilert

 

0 Kudos
Reply
Observer
Observer
7,350 Views
Registered: ‎04-19-2013

Hi,

I want to transmit m bytes in m 32-bit frames. I want to transmit 5 32-bits.

Thanks in advance
0 Kudos
Reply
Historian
Historian
7,341 Views
Registered: ‎02-25-2008


@sumimandal085 wrote:
Hi,

I want to transmit m bytes in m 32-bit frames. I want to transmit 5 32-bits.

Thanks in advance

REMEMBER that the standard UART assumes 8-bit data words. Certainly you can modify it to transmit 32-bit words, but then you need a receiver which can handle that. And if you're going into a PC, that is not possible.

----------------------------Yes, I do this for a living.
0 Kudos
Reply
Observer
Observer
2,752 Views
Registered: ‎04-19-2013

Is it necessary to use a receiver? Need to display on PC, so what i need to do?
Tags (1)
0 Kudos
Reply
Teacher
Teacher
2,747 Views
Registered: ‎08-14-2007

Hi,

are you making fun of us?

Whenever one implements some new transmitter for a newly "invented" protocoll, a compatible receiver is needed.

 

So if you want to communicate with a PC your interface has to fit the interfaces used on a PC.

As for now PC standard UARTs are limited to 8 Data bits. (sometimes 7 for teletype compatibility).

Do you know about some UART used in common PCs that can be configured to use more than one byte of data per frame?

 

What you need to do?

Well, I would recommend to stay with the standard UART frames, to acheive maximum compatibility and be able to use existing UART IPs in the FPGA.

Then you just need to break your 512 databits into 64bytes that can easily be sent to the PC with a simple UART using the common 8N1 format.

 

Since you now have some 64 byte block, you might consider taking precautions for the case that your transmission looses synchronisation.

e.g. If one byte goes missing for some reason all the following bytes cause the PC to display crap.

 

Have a nice synthesis

  Eilert