Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
11/25/04 12:18
Read: times


 
#81919 - Tried PCA!
Responding to: ???'s previous message
Dear Forum Members,

I have modified my hardware a bit by giving the zero cross pulse to PCA module 0 pin P1.3 and also modified my software to synchronize my timer 1 i.e. used for fire timing with zero cross using PCA module 0 capture feature. I have set the PCA module 0 to capture both negative and postive going transitions. Here is my Initialization code.

/*Initializing the envoirment*/
void init_ios(void)
{
	ioport=0xf0;
	P3=0xff;

	FIREPORT=1;
	IE=0;
	
	RCAP2H=0xfa;			//ADC sampling 20 samples per cycle
	RCAP2L=0xca;
	T2CON=0x00;
	TMOD=0x21;				//Timer 0 in 16 bit timer 1 8 bit autoreload.

	CH=0x00;				//clear PCA base counter.
	CL=0x00;
	CMOD=0x00;				//PCA clock sourc Fosc/6;
	CCAPM0=0x31;			//Put module 0 in capture mode. both transistions.			

	CCON=0x40;				//PCA start;

	TH1=0x7a;				//system timer ticks once 100us.
	TF1=0;
	IP=0x60;				//PCA highest and timet 1 higher priority set.
	IPH=0x48;
	IE=0x00;
	EA=1;					//Enabling global interrupts.
	EC=1;					//Enabling PCA interrupt;
	ET1=1;					//Enabling timer 1 interrupt.
	TR1=1;					//Start timer 1.
}


and here are my ISR for PCA and timer 1.

/*********Interrupt function for timer 1****************
This interrupt is always on and is 100us*/
void t1_isr(void) interrupt 3
{
	SYSTIME++;			//increament the SYSTIME variable used for fire timing
	if (SYSTIME>firedly && firecount  && ttbit && onfire)
	{
		FIREPORT=!FIREPORT;	//Put the fire pulse	
		firecount--;		//Reduce remining pulse counter.
	}
	else
		FIREPORT=1;		//Make fire pin 1 to keep transistor off.

	ttbit=!ttbit;			//fwbit to make firing pulse 200us
}

/*ISR for PCA modules 0 This interrupt is always ON*/
void cf_isr(void) interrupt 6 using 2
{
		firecount=6;	//set 6 pulses to be sent.
		fwbit=!fwbit;
		if (fwbit)		
			cycles++;	//Increament cycles every 2 half cycles.
		ioport=OPSTATUS;	//Refresh Output ports.
		SYSTIME=0x00;		//Reset SYSTIME variable.
		CCF0=0;			//clear the interrupt flag.
}


Even after doing above ie. properly synchronising the timer 1 with zero cross flickering remains as it is there is no change at all I have been pulling my hairs for past 40 hours but still it is a big mystry. I will get balt within few days if the problem is not solved. Please help me friends.

Thanks & Regards,
Prahlad Purohit

List of 42 messages in thread
TopicAuthorDate
Thyristor output flickering.            01/01/70 00:00      
   Thyristor problem            01/01/70 00:00      
      No Hardware problem            01/01/70 00:00      
      Please Elaborate more.            01/01/70 00:00      
   Thyristor problem            01/01/70 00:00      
      Re: Thyristor Problem.            01/01/70 00:00      
      Mains looks seldom like pure sinus            01/01/70 00:00      
         Thanks Kai But problem seems diffrent            01/01/70 00:00      
   Did the changes but still flickering.            01/01/70 00:00      
      Did the changes ....            01/01/70 00:00      
         Russell- Where can I get DSO software            01/01/70 00:00      
   More thoughts on filtering            01/01/70 00:00      
   Flickering is not minor.            01/01/70 00:00      
      Cool Edit            01/01/70 00:00      
         Cool Edit - no more :-(            01/01/70 00:00      
         Loading is enough.            01/01/70 00:00      
      interrupt configuration            01/01/70 00:00      
         I am not using External Interrupts.            01/01/70 00:00      
            external interrupt            01/01/70 00:00      
               I am reading only the edge detect flag.            01/01/70 00:00      
                  configuration again            01/01/70 00:00      
                     Here is the configuration.            01/01/70 00:00      
   Is it Int. prioprity setting proble?            01/01/70 00:00      
      Why not use the PCA?            01/01/70 00:00      
         It's too late to change the design.            01/01/70 00:00      
   Its not a interrupt priority problem.            01/01/70 00:00      
      Real -time problems            01/01/70 00:00      
   Tried PCA!            01/01/70 00:00      
      Firing circuit            01/01/70 00:00      
      hardware modification            01/01/70 00:00      
         Already modified with PCA SYSTIME>99            01/01/70 00:00      
      Sorry I small typpo in earlier post.            01/01/70 00:00      
   ideas            01/01/70 00:00      
      Problem Solving Great Idea            01/01/70 00:00      
   Assymetry            01/01/70 00:00      
   back to root            01/01/70 00:00      
      It is for power control.            01/01/70 00:00      
   Hey Friends Problem Solved.            01/01/70 00:00      
   Happiness is...            01/01/70 00:00      
      Oh sure....            01/01/70 00:00      
   here i am?            01/01/70 00:00      
      Thanks Kuldeep.            01/01/70 00:00      

Back to Subject List