want to generate 100khz pulses on D0 output pin

i want to generate 100khz pulses on D0 output pin
but it reaches 15khz and if i try to make it more
it crashes
can any one help me
thnx
zozo_dot_h@yahoo.com

Post your code that generates the 15kHz pulses.
What do you mean with it crashes?

the rabbit stp
and there is no output

#define CHANGE BitRdPortI(PADR, 2)
#define TRUE 1
#define FLASE 0
char Buff[4];
int nT7IntCount;
#define ID_BIT_7 0x80
int ID_TIMER_A1 ;
#define TRANSFER_RATE 38400//115200//57600//38400//19200//9600//57600//38400-115200
#define DINBUFSIZE 1023
#define DOUTBUFSIZE 1023
#define TIMEOUT 20UL
void InitTimers();
interrupt TimerA_ISR();
void SerInit();
void change();
void InitTimers()
{
//WrPortI(TAPR, NULL, 0x00); input timer is pck
// set up timers constants
WrPortI ( TAT1R, NULL, ID_TIMER_A1 );
WrPortI ( TAT7R, NULL, 10);
// set up ISR
SetVectIntern ( 0x0A, TimerA_ISR );
//enable priority 1 interrupt, A7 source: Pck/2
WrPortI ( TACR, &TACRShadow, 0x81);
//enable timer A1
WrPortI ( TACSR, &TACSRShadow, TACSRShadow | 0x01);
}

interrupt TimerA_ISR()
{
unsigned char ucInt;
#asm
ioi ld a, (TACSR) ; // clear the interrupt
ld (ucInt), a
#endasm
nT7IntCount++;
}
void Init()
{
ID_TIMER_A1 = 100;
WrPortI(GCSR, NULL, 0x08);
//ports
WrPortI(PDDDR, &PDDDRShadow, 0x01);
//WrPortI(PDDCR, &PDDCRShadow, 0x01);
WrPortI(SPCR,&SPCRShadow,0x080);
InitTimers();
}
void change()
{
float count ;
int n,i;
if ((n = serDread(Buff, 4, TIMEOUT)) > 0)
{
// printf("%f
",count);
count = ((float)(Buff));
ID_TIMER_A1 =(int)(1475000 / count);
if (ID_TIMER_A1 > 255) ID_TIMER_A1=255;
if (ID_TIMER_A1 < 1) ID_TIMER_A1=1;
WrPortI ( TAT1R, NULL, ID_TIMER_A1 );
for (i=0;i<4;i++)Buff[i]=0;
n = 0;
count=0;
}
}
main()
{
int i;
for (i=0;i<4;i++)Buff[i]=0;
Init();
WrPortI ( TACSR, &TACSRShadow, TACSRShadow | ID_BIT_7);
serDopen(38400);
serDparity(PARAM_NOPARITY);
serDdatabits(PARAM_8BIT);
serDflowcontrolOff();
serDrdFlush();
while(1)
{
#asm
ld a,59h
ioi ld (WDTCR),a
#endasm
if (CHANGE) change();
// generate pulses
if(nT7IntCount < 1)
BitWrPortI(PDDR, &PBDRShadow, 0, 0);
else if((nT7IntCount >= 1) && (nT7IntCount < 2))
BitWrPortI(PDDR, &PBDRShadow, 1, 0) ;
else if (nT7IntCount >= 2)
{
BitWrPortI(PDDR, &PBDRShadow, 0, 0) ;
nT7IntCount = 0 ;
}
}
}

You can get 50Khz with a PWM. I don’t think that would suffice for your application, but I thought I’d offer a tip.