Rob, use the term code between square brackets (remove the space between the [ and C of code)Originally Posted by Rob
Code:[ code ] [ /code ]
Rob, use the term code between square brackets (remove the space between the [ and C of code)Originally Posted by Rob
Code:[ code ] [ /code ]
Last edited by malc-c; - 22nd July 2006 at 10:26.
Hi Malc-c,
cheers for the reminder of "code", "close code"! If I had a brain that was big enough to support both my short term and long term memory I would probably be able to ......... no it's gone!
Chris, I presume this project is for a turbo-charged car?! Let me guess, something old skool, RS Turbo? You don't have to say, just interested!
Cheers
Rob
Last edited by Rob; - 22nd July 2006 at 10:42.
On demand Hydrogen generation from water as a catalyst/fuel in the combustion process. Water cools the flame instead of liquid gasoline, which is a terrible waste in all internal combustion engines today.
(The things they DON'T tell you in car 101. :-) )
I have the circuit working perfectly (with clearly labeled variables now.) I can't imagine how much time/pulled hair this saves even WITH the learning curve of using a PIC/Basic.
I'll be using another, separate one dedicated to creating a custom square wave (PWM) needed for another part of the design.
Chris
That sounds VERY interesting - best of luck with it!Originally Posted by ChrisHelvey
- Glad variables are helping you!I have the circuit working perfectly (with clearly labeled variables now.) I can't imagine how much time/pulled hair this saves even WITH the learning curve of using a PIC/Basic.
Chris, a little help with your project... you may already know this but anyways... the PIC16F877A also has Hardware PWM which is fantastic! You can set it and implement other code at the same time without worrying about its output frequency. You can easily change its frequency and stop the output alltogether. Check it out before using the PWM command.I'll be using another, separate one dedicated to creating a custom square wave (PWM) needed for another part of the design.
Good luck
Rob
I did NOT know that. That's fantastic. I don't use the PWM command to access it?
I suppose I should look at the datasheet, but if you feel inclined to point me the right direction, it's appreciated.
I was actually able to make a very nice square wave with an adjustable period/duty cycle by using pin on, pin off, and pauses. I won't need to make any duty cycle changes on-the-fly, but I may want to be able to turn it on and off at will.
Thanks.
This is a small portion of code that I wrote recently and may help you although it was written for a 16F628A:Originally Posted by ChrisHelvey
The best thing to do is to read the datasheet for that particular PIC though as you quite rightly said. Also refer to the Pic Basic Pro manual - extremely helpful!!Code:INTCON = %11000000 ' These 2 lines set the Timer 1 to be PIE1 = %00000001 ' utilised by enabling Global and Peripheral interrupts T2CON = %00000111 ' Timer 2 is needed by HPWM command CCP1CON = %00001100 ' This is needed also for HPWM command .................... HPWM 1, 127, 0 ' Make sure the jets are off pause 1000 frequency = 2510 ' Set frequency at start -15Hz for Hotspring. - FREQUENCY WAS A VARIABLE I ASSIGNED! hpwm 1, 127, frequency ' Output start frequency of 2510Hz
Bookmarks