The maximum you can store in an unsigned long int on your machine is 65535; so you are getting an error when you overflow the variable i.
Use nested loops like this:
Rich (BB code):
unsigned long int i;
unsigned int sec;
{
for(sec=0;sec<5;sec++)
{
for(i=0;i<30000;i=++)
{
NOP();
}
}
}