Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
20750 Discussions

Problem when doing a bulk erase using JTAG

Altera_Forum
Honored Contributor II
1,093 Views

Hello,  

 

I am trying to bulk erase a EPM7512AETC144-10 using a 68HC09 microcontroller connected to the JTAG pins of the MAX7000. According to the SVF file, a bulk erase requires the following instructions: 

 

!BULK ERASE 

SIR 10 TDI (00A); 

RUNTEST 1000 TCK; 

 

So I implemented a function in C to match theses instructions: 

 

int j=0; 

short int IRData[10]={0,1,0,1,0,0,0,0,0,0}; // 1st 10 bits of 0x00A (least significant bits first) 

 

///-----------Disable Interrupt------ 

# ifdef __HIWARE__ 

asm TPA; 

asm PSHA; 

asm SEI; 

# else 

# pragma asm 

TPA 

PSHA 

SEI 

# pragma endasm 

# endif 

 

 

PTD_PTD0 = 0; //TMS=0 

for (j=0;j<100;j++)clock_Cycle(); //Run test idle for 1ms at least 

PTD_PTD0 = 1; //TMS=1 

clock_Cycle(); //Select DR Scan 

clock_Cycle(); //Select IR Scan 

PTD_PTD0 = 0; //TMS=0 

clock_Cycle(); //Capture IR Scan 

clock_Cycle(); //shift IR Scan 

for (j=0;j<10;j++) 

PTD_PTD2 = IRData[j]; //Shifting data bits  

clock_Cycle();  

 

PTD_PTD0 = 1; //TMS=1  

clock_Cycle(); //EXIT IR  

clock_Cycle(); //UPDATE IR 

PTD_PTD0 = 0; //TMS=0 

clock_Cycle(); //run test idle  

 

///-----------Enable Interrupts------  

# ifdef __HIWARE__ 

asm PULA; 

asm TAP; 

# else 

# pragma asm 

PULA 

TAP 

# pragma endasm 

# endif  

break; 

 

However, when this function is called, the MAX7000 doesn't seem to be erased and is even still running. Does anybody see something wrong with this function? Or are there some instructions to perform before theses? I checked the waveforms for TMS and TDI and everything seems to be ok (See the attachment). 

 

Thanks , 

 

Cyril
0 Kudos
1 Reply
Altera_Forum
Honored Contributor II
337 Views

My recommendations: 

 

1. Check the TDO output with the scope as well. It should be high-z in all TAP controller states except shift DR and shif IR. So you can see if you managed to move the TAP controller to the appropriate state. 

 

2. There should be a TAP controller reset at the very beginning of your sequence 

 

PTD_PTD0 = 1; //TMS=1 

for (j=0;j<5;j++)clock_Cycle(); // test logic reset 

PTD_PTD0 = 0; //TMS=0 

clock_Cycle(); // test idle 

PTD_PTD0 = 1; //TMS=1 

... 

Hope that helps, 

Harald
0 Kudos
Reply