Picoblaze Assembly Language Delay

Status
Not open for further replies.

wuchy143

Member
Hi All,

I"m using Xilinx Spartan 3an dev board also with their soft core Picoblaze. I"m a noob to FPGA development and I"m also a noob at assembly language. I'm trying to make a walking LED on my dev board. I"m able to do everything except the delay after I write out the LEDs port(8-bit port). Does anyone have an idea of doing this delay. Say for a second?

Thanks!!

-mike
 
Do a simple loop, determine (via simulation) the number of cycles each loop produces, then loop enough times to create the desired time period. For passive timing using a timer with an appropriately derived prescaler is used to cause an interrupt instead of wasting all the processor cycles. Precision and outside factors have to be taken into account. Personally I think nearly every device should have a static 16 or 32 bit counter clockable via a prescaler and PLL.
 
Last edited:
well i'm using the Xilinx ISE 9.1 I got from the eval kit. It did some with the EDK as well but I haven't used that.
 
I don't know the picoblaze very well, but I think the basic delay is pretty generic to all MC's.

1) Initialize a register ( or a memory location ) with a value that determines the delay ( that value will be calculated in a moment )
2) make this the top of your loop. If the register, or memory, from step 1 is zero, branch to your LED lighting code
3) subtract 1 from the register or memory.
4) (optional) do something to waste time, ie a faux i/o operation
5) branch to step 2.

Now, add up all of the cycles used up in your loop. Multiply them by the clock period, then take the reciprocal. This becomes the number you use as the initial value in step 1.
 
Last edited:
Ah-Hah! I thought you needed EDK for Picoblaze. I could never find where to download it, but today I joined the Picoblaze Lounge, and was able to download.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…