Hi, if I download the datasheet (PIC18F2X_45K50-30000684B.pdf), it says the chip has one ECCP and one CCP module. The output of CCP2, the simple one, is on pin 12 (pin 9 on QFN package) and can be relocated to pin 24 (pin 21 on QFN). The outputs A,B,C and D of CCP1 are on pins 13, 23, 22 and 25 (10, 20, 19 and 22 on QFN). The Errata doesn't mention any problems with ECCP.
2kHz is not that fast, so you can use an interrupt of course. I try to avoid that, as interrupts can introduce some jitter (about +/-2Tcy) and if that causes a problem, it may be hard to trace. Greets, Kiste Am Montag, 2. August 2021, 06:38:36 MESZ hat vsurducan <[email protected]> Folgendes geschrieben: Hi Kiste, as far as I read my version of k50 (PIC18F25k50) does not have ECCP it in 28 pin, I have to stick on my available stock of microcontrollers during the inexistence at this point (Farnell, TME) of too many options to buy immediately PIC microcontrollers. Thanks for your solution, I think I will do it in interrupts using TMR0 for a short timebase, count it for the needed frequency and toggle the output pins. Yes, indeed a CLC would be helpful with the standard CCP... best wishes, On Sun, Aug 1, 2021 at 5:48 PM 'Oliver Seitz' via jallib <[email protected]> wrote: > Hi! > > Well... almost all 28pin? Chips with suffixes like k20, k22, k50, k80, j11, > j13, j50 and j80 do have ECCP, chips with suffixes like q40, q41, q43, q83, > q84, k42, k83 and numerous more have CWG and/or CLC modules, which both allow > the generation of those signals using a simple PWM. > > > With the PIC18F2550, I only have one idea... Externally feed the pmw signal > back to pins A0 and A1, set the CVRef module to somewhere in the middle, set > comparator mode 0b110, and set one of the CxINV bits. Then you have the > symmetric signals on C1out and C2out. It's not the most elegant solution, I > admit... > > Greets, > Kiste > > > > Am Sonntag, 1. August 2021, 14:58:43 MESZ hat vsurducan <[email protected]> > Folgendes geschrieben: > > > > > > Thx Rob, the bridge mode (enhanced CCP) works only for a 40 pin device, I > have a 28 pin device on my board. Enhanced CCP is available only on large > size microcontroller. :( Almost all 28 pin microcontrollers suffer from > this issue (PIC18F25k50, etc.) > Since I need two signals with opposite phases, 50% duty cycle, whose > frequency should be programmable between 1KHz and 2KHz I think they can be > generated in compare mode...or perhaps in software. I also need to trigger > an ADC read during the high level of those pulses from time to time. > > On Sun, Aug 1, 2021 at 2:17 PM Rob CJ <[email protected]> wrote: >> >> >> Hi Vasile, >> >> >> >> >> Not sure if I understood you correctly. If you want the PWM signals to be >>exactly the same but only inverted you can use the bridge mode for one of the >>PWM's that is when one output goes high the other goes low. >> >> >> >> >> >> >> >> >> >> >> >> >> >> Kind regards, >> >> >> >> >> Rob >> >> >> >> >> >> ________________________________ >> Van: [email protected] <[email protected]> namens vsurducan >> <[email protected]> >> Verzonden: zondag 1 augustus 2021 10:14 >> Aan: [email protected] <[email protected]> >> Onderwerp: [jallib] PWM versus enhanced PWM, oposite polarity output? >> >> >> >> >> >> Hi all, >> >> PIC18F2550, 28pin PIC device has only the PWM implemented, the enhanced PWM >> is available on 40/44pin devices only. However, If I want on a 28pin PIC >> two PWMs running at the same frequency, with the same duty-cycle, how can I >> generate one active high and one active low PWM signals without using any >> external inverter? No deadband between the output signals is required. >> >> Any experience is appreciated. >> >> thank you! >> >> >> >> -- >> You received this message because you are subscribed to the Google Groups >> "jallib" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/jallib/CAM%2Bj4qvHSZrsUtoF_1GcDrNS2_mup_hc5ZbYOuQu4uGw5TYuAQ%40mail.gmail.com. >> >> >> >> >> -- >> You received this message because you are subscribed to the Google Groups >> "jallib" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/jallib/AM0PR07MB624142E76C9FF412EBE22FC5E6EE9%40AM0PR07MB6241.eurprd07.prod.outlook.com. >> > > > -- > You received this message because you are subscribed to the Google Groups > "jallib" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/jallib/CAM%2Bj4qstLOMHMLtJcLLEfywQ_%2BTYOWzEUCkLtghwrskyk%3DO%3DAg%40mail.gmail.com. > > -- > You received this message because you are subscribed to the Google Groups > "jallib" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/jallib/592117056.1109097.1627829331026%40mail.yahoo.com. > -- You received this message because you are subscribed to the Google Groups "jallib" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jallib/CAM%2Bj4quga9W%2B1gNP1UFBJDR8cJM04eh24ecHRR8%2BA5uOcnC4Yw%40mail.gmail.com. -- You received this message because you are subscribed to the Google Groups "jallib" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jallib/1986154646.1189684.1627881553735%40mail.yahoo.com.
