Software Routines for UCLA TMB and ALCT --------------------------------------- S. Durkin Initialization and Returns -------------------------- In unix routines: ucla_start(slot,idev); /* open routine */ slot - vme slot address idev - device number 1=tmb registers 2=ALCT JTAG Chain 3=TMB Mezzanine FPGA +FPGA PROMS JTAG 4=TMB User Proms JTAG CHAIN 5=TMB FPGA User JTAG chain ucla_end(); /* close routine */ In between these calls you can call routines accessing the device at that slot multiple times. JTAG Commands - Device 2,3,4,5 ------------------------------ There are two jtag commands that can be called: void RestoreIdle() - sends 5 tms high cycles then one tms low cycle void scan(int reg, char *snd, int cnt, char *rcv,int ird) reg - instr=0 data=1 snd - input data rcv - received data ird - 0 write, buffered ird - 1 read, also sent immediately ird - 2 write,sent immediately for instance to send a 16 bit instruction - 0x1ffa char snd[2]; char rcv[2]; snd[0]=0xfa; snd[1]=0x1f; scan(0,snd,16,rcv,2); /* 2 means sent immediately */ there is also a special sleep mode required for svf programming: pause - D360 delay in usecs pause=pause/10; snd[0]=pause-(pause/256)*256; snd[1]=pause/256; scan(-1,snd,-99,snd,0); A more complex example of these calls can be found at: fast_daq/daqmb/tmb_routines/epromload_ucla.c TMB Registers (Device 1) ------------------------ There is a single routine that performs this operation. void tmb_vme(char fcn,char vme,char *snd,char *rcv,int wrt) fcn 1 - read 0 - write wrt 0 - buffer write 1 - send write immediately Various examples of calling this routine can be found at: fast_daq/daqmb/tmb_routines/*.c