nop before setting TCK

OpenOCD JTAG debugging with the Bus Pirate.

nop before setting TCK

Postby rdiez » Tue May 28, 2013 6:54 am

Hi Bus Pirate gurus:

I have been looking at OpenOCD_asm.S and found the following instruction and associated comment:

Code: Select all
   nop  ; /* still must pause a cycle because */
        ; /* we wrote [w9] last cycle ...     */


I do not know the Bus Pirate CPU, so I am only guessing when reading its assembly code.

Is there any hardware limitation that mandates you have to wait between consecutive writes to a GPIO port?

If so, could we do away with that nop and swap the next two or three instructions? That would mean reading TDO before TCK's rising edge, but that should be OK, because TDO should be ready to read right after TCK's last falling edge.

Thanks,
rdiez
rdiez
Newbie
Newbie
 
Posts: 13
Joined: Tue Sep 27, 2011 11:48 am

Re: nop before setting TCK

Postby ian » Mon Jul 08, 2013 11:17 pm

Thanks for looking through the code. Robots wrote that and would be the guy who would know best. I think your solution makes sense, but I did not double check the ASM reference for this PIC.
User avatar
ian
Crew
Crew
 
Posts: 10803
Joined: Mon Jul 06, 2009 6:14 am

Re: nop before setting TCK

Postby robots » Thu Jul 18, 2013 2:10 am

Assembly part of the code was written by TNT. And yes, you have to wait one instruction cycle between writes to GPIO. It is stated somewhere in Datasheet, and typically overlooked (Sjaak knows ;) )
User avatar
robots
Hero Member
Hero Member
 
Posts: 569
Joined: Sat Dec 05, 2009 11:19 am
Location: CZ/Prague

Re: nop before setting TCK

Postby Sjaak » Thu Jul 18, 2013 7:55 am

grumble grumble :D
User avatar
Sjaak
Fellow
Fellow
 
Posts: 3288
Joined: Sun Jan 03, 2010 2:45 pm
Location: Hiero


Return to OpenOCD JTAG

cron