FPGA Central - World's 1st FPGA / CPLD Portal

FPGA Central

World's 1st FPGA Portal

 

Go Back   FPGA Groups > NewsGroup > FPGA

FPGA comp.arch.fpga newsgroup (usenet)

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-11-2007, 05:41 PM
axr0284
Guest
 
Posts: n/a
Default picoblaze RS-232 using 62.5 MHz

Hi,
I was currently using picoblaze with RS-232 with the FPGA running at
50 MHz and it worked fine. I now need to run it at 62.5 MHz. From the
information I hve gathered, to attain a baud rate of 115200, I would
need a clock frequency of 115200 * 16 = 1843200 Hz or something close
to that.

In the picobalze hdl file, there is a counter that counts 27 cycle at
50 MHz to obtain 1851851 Hz and it seems to work fine with the RS-232.
So I figure 33 cycles at 62.5 MHz to obtain 1893939 Hz should also work
but I keep getting garbage on the terminal program on the computer. I
have tried 32 cycles as well as 34 cycles without any luck.

I was wondering if anybody has tried this before and can shed some
light on the matter. Thanks a lot,
Amish

Reply With Quote
  #2 (permalink)  
Old 01-11-2007, 06:20 PM
John_H
Guest
 
Posts: n/a
Default Re: picoblaze RS-232 using 62.5 MHz

UARTS are good for a bit of a frequency mismatch but going from .47% error
to 2.75% error appears to be too much for your system to handle. Consider
dividing 62.5 MHz by 34 instead to get .27% error. It shouldn't be
important that 1838235 Hz is less than 1843200 Hz but that it's much closer
than 1893939 Hz.


"axr0284" <[email protected]> wrote in message
news:[email protected] oups.com...
> Hi,
> I was currently using picoblaze with RS-232 with the FPGA running at
> 50 MHz and it worked fine. I now need to run it at 62.5 MHz. From the
> information I hve gathered, to attain a baud rate of 115200, I would
> need a clock frequency of 115200 * 16 = 1843200 Hz or something close
> to that.
>
> In the picobalze hdl file, there is a counter that counts 27 cycle at
> 50 MHz to obtain 1851851 Hz and it seems to work fine with the RS-232.
> So I figure 33 cycles at 62.5 MHz to obtain 1893939 Hz should also work
> but I keep getting garbage on the terminal program on the computer. I
> have tried 32 cycles as well as 34 cycles without any luck.
>
> I was wondering if anybody has tried this before and can shed some
> light on the matter. Thanks a lot,
> Amish



Reply With Quote
  #3 (permalink)  
Old 01-11-2007, 07:31 PM
axr0284
Guest
 
Posts: n/a
Default Re: picoblaze RS-232 using 62.5 MHz

I have tried that and I still get garbage. This is weird. I am
wondering if the rest of the UART has something to do with this. Maybe
additional changes need to be made.
Amish

John_H wrote:
> UARTS are good for a bit of a frequency mismatch but going from .47% error
> to 2.75% error appears to be too much for your system to handle. Consider
> dividing 62.5 MHz by 34 instead to get .27% error. It shouldn't be
> important that 1838235 Hz is less than 1843200 Hz but that it's much closer
> than 1893939 Hz.
>
>
> "axr0284" <[email protected]> wrote in message
> news:[email protected] oups.com...
> > Hi,
> > I was currently using picoblaze with RS-232 with the FPGA running at
> > 50 MHz and it worked fine. I now need to run it at 62.5 MHz. From the
> > information I hve gathered, to attain a baud rate of 115200, I would
> > need a clock frequency of 115200 * 16 = 1843200 Hz or something close
> > to that.
> >
> > In the picobalze hdl file, there is a counter that counts 27 cycle at
> > 50 MHz to obtain 1851851 Hz and it seems to work fine with the RS-232.
> > So I figure 33 cycles at 62.5 MHz to obtain 1893939 Hz should also work
> > but I keep getting garbage on the terminal program on the computer. I
> > have tried 32 cycles as well as 34 cycles without any luck.
> >
> > I was wondering if anybody has tried this before and can shed some
> > light on the matter. Thanks a lot,
> > Amish


Reply With Quote
  #4 (permalink)  
Old 01-11-2007, 08:03 PM
axr0284
Guest
 
Posts: n/a
Default Re: picoblaze RS-232 using 62.5 MHz

I think the issue might be in my code. I'll have to debug it.
Amish

axr0284 wrote:
> I have tried that and I still get garbage. This is weird. I am
> wondering if the rest of the UART has something to do with this. Maybe
> additional changes need to be made.
> Amish
>
> John_H wrote:
> > UARTS are good for a bit of a frequency mismatch but going from .47% error
> > to 2.75% error appears to be too much for your system to handle. Consider
> > dividing 62.5 MHz by 34 instead to get .27% error. It shouldn't be
> > important that 1838235 Hz is less than 1843200 Hz but that it's much closer
> > than 1893939 Hz.
> >
> >
> > "axr0284" <[email protected]> wrote in message
> > news:[email protected] oups.com...
> > > Hi,
> > > I was currently using picoblaze with RS-232 with the FPGA running at
> > > 50 MHz and it worked fine. I now need to run it at 62.5 MHz. From the
> > > information I hve gathered, to attain a baud rate of 115200, I would
> > > need a clock frequency of 115200 * 16 = 1843200 Hz or something close
> > > to that.
> > >
> > > In the picobalze hdl file, there is a counter that counts 27 cycle at
> > > 50 MHz to obtain 1851851 Hz and it seems to work fine with the RS-232.
> > > So I figure 33 cycles at 62.5 MHz to obtain 1893939 Hz should also work
> > > but I keep getting garbage on the terminal program on the computer. I
> > > have tried 32 cycles as well as 34 cycles without any luck.
> > >
> > > I was wondering if anybody has tried this before and can shed some
> > > light on the matter. Thanks a lot,
> > > Amish


Reply With Quote
  #5 (permalink)  
Old 01-12-2007, 04:14 AM
-jg
Guest
 
Posts: n/a
Default Re: picoblaze RS-232 using 62.5 MHz


axr0284 wrote:
> I think the issue might be in my code. I'll have to debug it.
> Amish


You could try an intermediate freq, just in case your total system has
hit a speed ceiling

Also, check the bit timing with a scope to confirm you have the numbers

right.

Some of the better UARTS support fractional baud define, where
they do not always use 16 clks per bit, but can rate-multiply
between 15 or 16, over the Rx bits. That gives you more Xtal
freedom, and you can get closer to the precise baud rate,
or higher baudrates.

-jg

Reply With Quote
  #6 (permalink)  
Old 01-12-2007, 08:23 PM
Eric Crabill
Guest
 
Posts: n/a
Default Re: picoblaze RS-232 using 62.5 MHz

Hi,

I have used a similar approach with Ken Chapman's UARTs, where I wanted to
run at 115200 baud with a 25 MHz reference clock. This particular
combination has significant mismatch with an integer enable count, so I did
this:

always @(posedge clk)
begin
if (en_16_x_startover) en_16_x_cntr <= 0;
else en_16_x_cntr <= en_16_x_cntr + 1;
end

assign en_16_x_startover = (en_16_x_cntr == 26);
assign en_16_x_baud = (en_16_x_cntr == 26) || (en_16_x_cntr == 13);

It's always 16 enables per bit, but the enables come every 14, 13, 14, 13...
cycles. That was good enough to solve my problem.

Eric

"-jg" <[email protected]> wrote in message
news:[email protected] oups.com...
>
> Some of the better UARTS support fractional baud define, where
> they do not always use 16 clks per bit, but can rate-multiply
> between 15 or 16, over the Rx bits. That gives you more Xtal
> freedom, and you can get closer to the precise baud rate,
> or higher baudrates.
>
> -jg



Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
PicoBlaze and DDR Ram karrelsj FPGA 4 06-28-2006 02:00 AM
Picoblaze, UART: need help!! preet FPGA 1 03-31-2006 11:15 AM
rs232 and picoblaze :) [email protected] FPGA 2 12-18-2005 08:09 AM
picoblaze icegray FPGA 1 03-17-2005 02:00 PM
C Compiler for Picoblaze !!!!! Francesco Poderico FPGA 9 11-12-2004 05:56 PM


All times are GMT +1. The time now is 04:25 AM.


Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
Copyright 2008 @ FPGA Central. All rights reserved