Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Newbie JTAG-FPGA question

Status
Not open for further replies.

Krelian

Newbie level 3
Newbie level 3
Joined
Aug 8, 2007
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Visit site
Activity points
1,313
I have a XILINX protoboard with a XC3S200 & XCF01P , which i'm trying to program via Raspberry PI.

It loads a Demo program that, makes some leds blink in either direction, and react to 2 buttons

Schematic can be seen here: **broken link removed**

Im trying to get my Rpi to read the IDCODE for starters, and this is where i'm stuck :(

I've successfully (or it seems so) read IR length to 14 bits (8bit for XCF01P, and 6bit ofr XC3S200), btw when sending TMS to travel between registers, is the value of TDI important?
And by putting all 1's in in IR, it seems to give me 2 TCK, before I see TDI on TDO (so 2 devices)

Now some say that by go to Test-Logic-Reset, and then to shift DR, one can read the IDCODE'S of the devices.

here's what i got:
Device 1: 0x80A0A049
Device 2: 0xFA822049

I've also tried to send to 0x09 to FPGA.
Since it's a 14bit register length here the bit sequence im sending (please tell if I send data wrong xD)
X is unknown,don't care

Into SHIFT-IR

TDI: 1, TMS: 0 (1X XXXX XXXX XXXX)
TDI: 0, TMS: 0 (01 XXXX XXXX XXXX)
TDI: 0, TMS: 0 (00 1XXX XXXX XXXX)
TDI: 1, TMS: 0 (10 01XX XXXX XXXX)
TDI: 0, TMS: 0 (01 001X XXXX XXXX)
TDI: 0, TMS: 0 (00 1001 XXXX XXXX)

//the next ones I have tried with both all 1's and all 0's
TDI: 1, TMS: 0 (1001001XXXXXXX)
TDI: 1, TMS: 0 (11001001XXXXXX)
TDI: 1, TMS: 0 (111001001XXXXX)
TDI: 1, TMS: 0 (1111001001XXXX)
TDI: 1, TMS: 0 (11111001001XXX)
TDI: 1, TMS: 0 (111111001001XX)
TDI: 1, TMS: 0 (1111111001001X)
TDI: 1, TMS: 1 (11111111001001) //Correct me if wrong, but last bit I send and want in register, TDI and TMS have to be HIGH, when TCK is set HIGH

This should to my understanding, PUT FPGA in IDCODE mode, and PROM into BYPASS mode

when I go to shift-DR, all i read is 1's

While experimenting back and forth, I also stumbled across the following.

If i send only 0's into the FPGA (SAMPLE), and the PROM doesn't matter, then if i go to Run-Test/Idle or either SELECT ** SCAN, my FPGA's DONE pin goes high, is this the right function?
 

Are you trying to bit-bang your own jtag, or do you use an application? If so, which one? There's nothing wrong with bitbanging your own jtag (been there done that :p ) but if you roll your own stuff you might want to have a look at either urjtag or openocd. Even when doing it DIY style that can be useful.

Plus a quick google on "openocd rpi" yields this one: https://code.google.com/p/picnc/wiki/OpenOCD_PIC32_Programmer

That's for a PIC, but who cares. jtag is jtag.

Hope that's of some use.
 

Btw noticed that

Device 1: 0x80A0A049
Device 2: 0xFA822049

if I Shift this left and +1, It would give me the right ID's
So now i just need to figure out why xD

and yes im bit-banging it.
 

Device 1: 0x80A0A049
Device 2: 0xFA822049

if I Shift this left and +1, It would give me the right ID's
So now i just need to figure out why xD

Precisely that sort of thing is why I suggested taking a look at existing sources like urjtag / openocd ... Eons ago when I also did the bit-banged jtag for the fun of it, I ran into similar problems. And it's always something stupid like forgetting to shift an extra bit or <fill_in>.
 

Yeah got it to work now, urjtag, gave me a few pointers :), btw do I assume correct that when reading IDCODE, the first code i get is from the last chip in the chain? (properly a stupid question xD, just wanting to make sure, only worked with PIC16's before.)
 

Well, you can think of the chain as a big long shift register. So whichever chip has it's data out closest to your jtag controller is first. And whichever chip has the data in closest to your jtag data out will be last.

Quick google ... ah, this explains it well: https://www.fpga4fun.com/JTAG2.html
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top