CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

pic16F887 Half Bridge problem
Goto page Previous  1, 2, 3  Next
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
aliaj00



Joined: 11 May 2011
Posts: 24

View user's profile Send private message

PostPosted: Sat May 14, 2011 7:00 pm     Reply with quote

dont know how to attach screenshot here Arrow Laughing Laughing Laughing Laughing Laughing
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sat May 14, 2011 7:28 pm     Reply with quote

Go to a free image hosting service such as http://www.imageshack.com
and post it there. Then post the link here.
aliaj00



Joined: 11 May 2011
Posts: 24

View user's profile Send private message

PostPosted: Sun May 15, 2011 11:21 am     Reply with quote

Yes I just uploaded it now.

http://imageshack.us/photo/my-images/823/506khzsofthalfbridgefix.jpg/
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sun May 15, 2011 12:27 pm     Reply with quote

Post your schematic.
aliaj00



Joined: 11 May 2011
Posts: 24

View user's profile Send private message

PostPosted: Mon May 16, 2011 1:33 am     Reply with quote

It is just the pic debugger with the 16F887 on it. and on RB1 RB3 there are the darlington with 500 Ohm resistance on the base. I didn't made a schematic for it as it has fewer than 10 Elements. Smile
aliaj00



Joined: 11 May 2011
Posts: 24

View user's profile Send private message

PostPosted: Mon May 16, 2011 2:58 am     Reply with quote

Hi PCM programmer,

how can i insert a rs232 into the code to change the parameters but not to loop through it in the while statement, as i will be forced to enter an answer each time. Smile Wink

BR's

shpetim Aliaj
Ttelmah



Joined: 11 Mar 2010
Posts: 19506

View user's profile Send private message

PostPosted: Mon May 16, 2011 4:12 am     Reply with quote

Basic technique. Two 'modes' of operation.
'Normal' mode. Sit in your loop, and at one point do a 'kbhit'.
If this is true, read the single character from the serial. Then have a 'decision', so if (for example), the character 'C' is there, you switch to 'config' mode.
Then send a little prompt for the data you want, and read the return. With a bit of ingenuity (again kbhit, and a timer), you can have it that if no reply is seen in say 30 seconds, the code automatically returns to 'normal' mode.

On your circuit, what are the darlington's actually driving?. Is it inductive?. If so, what circuitry have you got to trap the energy stored in the inductor, when the transistors switch off?.

Best Wishes
aliaj00



Joined: 11 May 2011
Posts: 24

View user's profile Send private message

PostPosted: Mon May 16, 2011 6:55 am     Reply with quote

the darlington are 2SD2390 each with 10 AMP of load or more. i attached the metallic radiator to them and also a cooler on each one of them as the heat generated was burning them "with only metallic radiator". i have tried with all loads, pure heater from old oven :P, Big COIL 2.5MM2 100 turns etc to test it. they have a diode from what i remember. i am not sure need to check.
aliaj00



Joined: 11 May 2011
Posts: 24

View user's profile Send private message

PostPosted: Mon May 16, 2011 6:56 am     Reply with quote

i have tested in the 5.06Khz to 32 khz
aliaj00



Joined: 11 May 2011
Posts: 24

View user's profile Send private message

PostPosted: Mon May 16, 2011 6:59 am     Reply with quote

can i put a push button on it and generate a interrupt so when i want to update the timing i can trigger the rs232 code and than to have it running without the rs232 routine.

BR's

Shpetim Aliaj
Ttelmah



Joined: 11 Mar 2010
Posts: 19506

View user's profile Send private message

PostPosted: Mon May 16, 2011 7:30 am     Reply with quote

No point in using an interrupt. Just have one instruction in your loop, testing if the input pin is in the 'active' state. If it is, switch to the config mode.
This is exactly like 'bootloader' code, where as the chip wakes up, an input pin is tested, and if it is in the active state, the code switches to the bootloader. Zero point (and several potential problems), trying to use an interrupt for this. Much simpler just to poll the pin.

Best Wishes
aliaj00



Joined: 11 May 2011
Posts: 24

View user's profile Send private message

PostPosted: Mon May 16, 2011 7:43 am     Reply with quote

thanks a lot,

i am just new with the pics after PC programming, networking and electronic stuff. Laughing Laughing

PS. by the way do you have a code snippet for this.
aliaj00



Joined: 11 May 2011
Posts: 24

View user's profile Send private message

PostPosted: Tue May 17, 2011 5:56 am     Reply with quote

i will try to put a bc557 and an irfp31n50l as the driver as it have 30AMP and use the bc557 as phase corrector.
Ttelmah



Joined: 11 Mar 2010
Posts: 19506

View user's profile Send private message

PostPosted: Tue May 17, 2011 6:55 am     Reply with quote

On the question of 'code snippet', not really. This is so basic, that there isn't much to show!...
Typical thing would be to have a button connected to a pin (say B2), pulling it to ground. Then have a pull-up on this pin (either use the internal pull-ups, or a resistor).
Then just organise your code as:
Code:

   do {
      //Your main loop code here


      if (input(PIN_B2)==0) {
         //If driving hardware, switch it to the idle state here
         setup(); //call the setup routine
         //switch drivers back to run mode - with the new settings
      }
   while (TRUE);


Then your main code runs, _until_ the button pulls the line low.
When it does, make sure you set your hardware to a 'safe idle' state, and then call your setup routine.

Nothing is called, till the line goes low, so the overhead, is just the single input test instruction.

Best Wishes
aliaj00



Joined: 11 May 2011
Posts: 24

View user's profile Send private message

PostPosted: Tue May 17, 2011 10:31 am     Reply with quote

thanks a lot Smile

i will do it.

i tested with the bc557 and irfp31n50l and it seems to work not much measuring but at least it still not burned. i got an 2n3440 and will try it with the irfp31n50l. maybe it has better response time.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page Previous  1, 2, 3  Next
Page 2 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group