UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
7,762 Views
Registered: ‎07-07-2012

Spartan3e, serial slave, no activity after startup

Thanks in advance for reading my case.

Hardware:
I made a board on which a microcontoller configures an XC3S250E-4VQG100C fpga in serial slave mode.
I connected the M[0:2], HSWAP, CCLK, DIN, PROG_B, INIT_B and Done pins to the microcontroller.
Because the microcontroller uses 3,3V I operate the PROG_B pin in pseudo open drain mode.
The 2,5V high level of the DONE pin is way above the logic high threshold of the IOs on the microcontroller.
SPI hardware is connected to the CCLK and DIN pins. So clock and data is sent in groups of eight bits.
The clock on CCLK is 4MHz.
The SPI hardware operates in mode 0.
http://en.wikipedia.org/wiki/Serial_Peripheral_Interface_Bus#Mode_numbers

Oscilloscope:
To make sure all the signals were comming through as intended, I did some measurements with my oscilloscope.
All signals look clean, I didn't expect a lot of trouble with that in the first place, because of the low clock speeds
M[0:2] are set high
HSWAP is set high
PROG_B goes low for 1msec
After the rising edge of PROG_B, INIT_B goes high after 150usec. INIT_B does not go low again after that.
Done goes high on the rising edge of the 7th clock pulse of a group of eight.
After that group there are still 15*8 bits left before the end of the .bin file. They are still sent to the fpga.
After the end of data 2*8 dummy bits are sent.
M[0:2] and HSWAP are set to float.

Test:
To test the functionality of my board I made a simple schematic design in ISE14.1.
I divide down an 8MHz clock with some counters, at the end a flipflop toggles two IOs on which LEDs are connected.
When I use a jtag cable and chose jtagclk as the startup clock the LEDs start flashing as they should.
But when I try it with my microcontroller and CCLK as the startup clock I can see the initial IO states, one LED is on and one is off.

So I have to conclude that something goes wrong near the very end of the startup sequence.
Also this same behavior is seen on my second prototype.

Some Bitgen options I used:
CRC is enabled, DriveDONE is enabled, DonePipe is disabled, DONE_cycle is 4, GTS_cycle is 5, GWE_cycle is 6, ProgPin and UnusedPin are set to float, DonePin has a pullup and bitstream compression is enabled.

I searched this forum, but I couldn't find my specific issue.
I used the UG332, XAPP453 and DS312 pdfs but, although they were usefull, they didn't solve my current issue.

Thanks in advance for your suggestions.

0 Kudos
8 Replies
Instructor
Instructor
7,754 Views
Registered: ‎08-14-2007

Re: Spartan3e, serial slave, no activity after startup

Usually startup problems boil down to one of four things:

 

1) FPGA does not see the DONE pin go high because something else in the system is

holding it below the logic threshold (common beginner mistake using an LED to ground).

This can be worked around by enabling the internal DONE pipe.

 

2) Wrong startup clock selected.  i.e. JTAG clock is selected in the bitgen options, but you use

slave serial mode.

 

3) Board power supply cannot handle surge when the FPGA starts up.  This can cause the FPGA

to go into reset and lose its program.

 

4) Not enough clocks are issued after DONE goes high to complete the DONE startup pipe.

 

From your descriptions, I don't really see any of these issues.  However it couldn't hurt to

try enabling the internal DONE pipe.

 

-- Gabor

-- Gabor
0 Kudos
7,744 Views
Registered: ‎07-07-2012

Re: Spartan3e, serial slave, no activity after startup

I don't have an oscilloscope here at the moment but I just tried your suggestions.

 

1) I've tried just now with DonePipe enabled, but it doesn't seem to have had any effect.

 

2) I double checked it and generated the .bin again, but it looks like I had this one correct already

 

3) The board supply... I haven't noticed anything like a voltage drop yet. I have 250mAmps availible for each voltage(3,3 2,5 and 1,2). Though they are limited to 500mA combined. I assumed that would be enough. I'll check it tomorrow anyway.

 

4) I have no idea what the number of clocks should be after the done pin goes high, I've read somewhere that 16 would be enough. I supply about 17*8 clocks after DONE goes high. I'll try to increase that number.

 

I also tried to change the startup sequence by putting Done_cycle on position 6. And GTS, GWE before that.

It had no effect.

0 Kudos
7,727 Views
Registered: ‎07-07-2012

Re: Spartan3e, serial slave, no activity after startup

I've checked the board supply, the 3,3V does wiggle a bit when there is a lot of activity. But it is nothing extreme.

The 1,2V and the 2,5V are alright as well. I don't think it is the supply.

 

I increased the number of cycles after DONE goes high, but even after 200*8 cycles there is no change.

So I don't think this is it.

 

 

0 Kudos
Instructor
Instructor
7,714 Views
Registered: ‎08-14-2007

Re: Spartan3e, serial slave, no activity after startup

Looking back at your original post, I still have a hard time seeing this as a configuration problem.

DONE is going high, and at least one LED is turning on.  So the only thing that seems to be the

issue is clocks and/or resets of the design itself.  Is it possible that the microcontroller is somehow

causing the design to stay reset and / or preventing the 8 MHz clock from getting into the FPGA?

 

Another thing is do you use a DCM in this design?  Failure of DCM to lock can cause issues like this.

If you use a DCM, I would suggest taking it out of the design for the test and just wire the clock directly

to a BUFG instead.

 

In any case it seems that the system is in a different state when the micro loads the FPGA than when

you load it via JTAG.

 

-- Gabor

-- Gabor
0 Kudos
7,703 Views
Registered: ‎07-07-2012

Re: Spartan3e, serial slave, no activity after startup

I don't use a DCM yet, this was supposed to be a simple test program.

I've measured that 8MHz signal on the pin of the package and it tooks really clean.

The only way I know of to delay a start up is to externally keep the DONE pin pulled down, but I don't do that.

 

Now I've tried something else, the most simple design ever in ISE.

A pin with a pullup enabled is linked to a pin with an LED on it. So there is no clock used in the schematic.

Just connect the pin with the pullup on it to ground to switch the LED.

And that works!

 

Should I conclude that my original test program was bugged in some way?

0 Kudos
Instructor
Instructor
7,698 Views
Registered: ‎08-14-2007

Re: Spartan3e, serial slave, no activity after startup

Should I conclude that my original test program was bugged in some way?

 

Not if, as you mentioned in the first post, it worked when loaded via JTAG.  It still

seems like there's something going on with clocks and/or reset.  Just out of curiosity,

was the bitstream the exact same one you used with the microcontroller?  If not,

you should make sure that the same one used by the microcontroller still works using

JTAG.

 

The only way I know of to delay a start up is to externally keep the DONE pin pulled down, but I don't do that.

 

When you build the bitstream with "enable internal DONE pipe" even pulling DONE low should not

delay start up.

 

If this is a startup issue, then it appears to be related to the GWE (global write enable) signal,

because the GTS (global tristate) is clearly released as evidenced by the LED lighting.  In the

case of your very simple design (no flip-flops) GWE would not affect the design operation.

 

-- Gabor

-- Gabor
7,689 Views
Registered: ‎07-07-2012

Re: Spartan3e, serial slave, no activity after startup

I have identified a mistake I made earlier on.

I set the Mode pins as 111 to configure in serial slave mode, then they are set to tri-state.

They are never set to 101, to enable the jtag configuration mode. It is strange that the Digilent software doesn't report some sort of error.

What I saw was my two LEDs lighting up dimly, I assumed this was because the LEDs were being switched faster than I could see, sloppy mistake.

I assume that the fpga got into some undefined state by trying to configure it via jtag with the wrong mode pins set.

And that that produces a weak pulldown on the IOs? I haven't got a clue, this is the first fpga project I did where I had to worry about the configuration process.

 

Anyway, so I changed my firmware so the mode pins are set to 101 after configuring the fpga in serial slave mode, thus enabling the jtag configuration mode. And it worked. My super simple test program ran just like when it was programmed in serial slave mode.

So then I just tried my first test program, the one where the LEDs didn't toggle. And now I get the exact same behavior as when I programmed it in serial slave mode, one LED is on.

That is great! Because that is one big step towards the conclusion that it was some design mistake in ISE.

So now I'm going to step by step expand my simple test program with some logic and a clock signal to see if it keeps working. 

0 Kudos
7,672 Views
Registered: ‎07-07-2012

Re: Spartan3e, serial slave, no activity after startup

Ok, I have step by step created a blinking LED which runs on my divided 8MHz clock.

It is a proper slow blink so there is no uncertainty about it functioning.

It works via JTAG and when I switch the startup clock to CCLK it works as well, consistently.

 

Thank you Xilinx forum!

0 Kudos