are we looking at the same Datasheet??? according to the one i have here it has 1 CCp pin on RC5??I have been reading through this thread.... I see where there is major confusion..
There is a pic18f23k22...
This chip has seven timers so it has CCP1, CCP2,CCP3 CCP4 and CCP5
So using pins RC2 ( CCP1) RC1 (CCP2) and RC6 (CCP3) You can use three completely different modules with different duty cycles or periods....
first off i think you have been disingenuous with LG, he is very young and put ALOT of effort into helping you.Thanks for the post Ian. Hopefully this thread will be of some assistance in your project. THAT'S what this forum is for. The conveyance of information.
My main goal was COST. Yes a better pic with more PWM outputs would have been better but at what price?
Yes a transistor or Fet on the PWM output would be a easy fix but why not use the resources available. In this case 4 PWM outputs that are multiplexed together. Heck why not put a transistor or Fet on each output or use a uLN2308 instead(think I got the right numeration?). Then stuff a voltage regulator, a Mosfet for preventing the batteries from being inserted in backwards. The list could be endless but COST was my first item on the list.
Hopefully Ghostman 11 has a beer or brandy with that popcorn--lol
After making changes as per Tumbleweed the dang led blinks now. I am going to compare what Tumbleeweed posted and what I had for the module in post #86. I know I tried using CONFIG and kept getting compile errors. I want to try and find out WHY.
Config
FOSC = IRC, ' internal RC osc
PLLEN = OFF, ' PLL is under software control
Here is my main code
Here is the module NOTE only the last 5 lines are enabled.
Code:Module osc1322 { Config FOSC = HS 'HS oscillator Config PLLEN = OFF ' PLL is under software control PCLKEN = On ' Primary clock enabled FCMEN = OFF ' Fail-Safe Clock Monitor disabled IESO = OFF 'Oscillator Switchover mode disabled PWRTEN = OFF ' PWRT disabled BOREN = OFF ' Brown-out Reset disabled in hardware and software BORV = 22 ' VBOR set to 2.2 V nominal WDTEN = OFF ' WDT is controlled by SWDTEN bit of the WDTCON register WDTPS = 128 ' 1:128 MCLRE = OFF ' RE3 input pin enabled; MCLR disabled HFOFST = OFF ' The system clock is held off until the HFINTOSC is stable. STVREN = On 'Stack full/underflow will cause Reset LVP = OFF ' Single-Supply ICSP disabled BBSIZ = OFF ' 1KW boot block size XINST = OFF ' Instruction set extension and Indexed Addressing mode disabled } mclr = 0 OSCCON = %01100011 ' SCS<1:0> 00 = Primary clock OSCCON2 = %00000111 ' PRI_SD<2> = Osc drive circuit on ANSEL = %00000000 ' all digital ANSELH = %00000000 ' all digital 'TRISC = %00000000 ' portC cleared for output
Then that's a problem. You HAVE to set the CONFIG properly, and as been said many times you can't rely on the defaults to match your hardware.
Try this:
Code:Module osc1322 Config FOSC = IRC, ' internal RC osc PLLEN = OFF, ' PLL is under software control PCLKEN = OFF, ' Primary clock drive disabled (using internal) FCMEN = OFF, ' Fail-Safe Clock Monitor disabled IESO = OFF, ' Oscillator Switchover mode disabled PWRTEN = ON, ' PWRT enabled BOREN = OFF, ' Brown-out Reset disabled in hardware and software BORV = 22, ' VBOR set to 2.2 V nominal WDTEN = OFF, ' WDT is controlled by SWDTEN bit of the WDTCON register WDTPS = 128, ' 1:128 MCLRE = ON, ' RA3 input pin disabled; MCLR enabled HFOFST = OFF, ' The system clock is held off until the HFINTOSC is stable. STVREN = ON, 'Stack full/underflow will cause Reset LVP = OFF, ' Single-Supply ICSP disabled BBSIZ = OFF, ' 1KW boot block size XINST = OFF, ' Instruction set extension and Indexed Addressing mode disabled DEBUG = OFF OSCCON = %01100010 // IRCF=8MHz, SCS1=1 (int osc) OSCCON2 = 0 OSCTUNE = %10000000 // INTSRC=1, PLLEN=0, TUN=0 // set all pins digital ANSEL = $00 ANSELH = $00 CM1CON0 = 0 CM2CON0 = 0 VREFCON1 = $00
If one looks through this thread, a lot of stuff is rehashed over several times.
I stated on the first page the pic I want to use and why.
Layed out what my plan is with 3 candles. Rehashed about four times.
I asked if the schematics I posted were easy to read as I used the suggestions from several years ago. No reply. It was mentioned what compiler version I was using and I failed to reply that I am using the FREE version.
The one member that has offered concise information is Tumbleweed. His three or four post are to the point. No derogatory remarks etc.
I don't pretend to be an expert in electronics or associated field but I do like to experiment. Have learned a lot from Bebe and Jonsea or what ever name he is going by these days and I have thanked him numerous times as well as mention his development board which is an easy to use board. I used to use a Junebug and switched to a Pickit2 and eliminated several little bugs that were creeping into my projects. This alone (using the Junebug) caused some cyberdust or aggravation with certain members to the extent I have been cussed at with four letter words. YES I tend to ask lots of questions but a question is better than not asking and getting lost without information. I even defended Jonsea from being banned a second time. I hold no grudges. They tend to slow down or stop the exchange of information.
On this project I stated from the beginning what my goal was and how I hopefully going to achieve it.
are thats because you are not used to the Mr Deb threadsWhy does it seem this thread is getting no ware?
Lol it's kind of crazy but it's so much fun reading all this. Jon his chip didn't come on cause the ostune setting was wrong. And little ghost has done a great job posting. I wish I could write as good as he is his learning skills look really sharp for his age.
And his comprehension he's going places..
Now for the flame set two pin for color and kill the power to make it look real is all that's needed.
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?