- sh.png (7.44 KiB) Viewed 3520 times
Search found 28 matches
Re: PIC12f510
Bit 4 - Enabled. Apply this reset scheme. Configuration word is present in file "сof" 0x3ffa
Re: PIC12f510
I remove this tick and it starts working. If you are programming the chip not from the FC environment but through the programmer, load the file "cof". Try mine
Re: PIC12f510
This example works in the simulator. Pay attention to the project options. Do not set "automatic erase". If it does not work in hardware, you will need to restore the calibration constant using a programmer
- Wed Jan 08, 2025 12:34 pm
- Forum: Feature Requests
- Topic: PWM + Сapture + Сomparison
- Replies: 36
- Views: 15942
Re: PWM + Сapture + Сomparison
If anyone is still interested. I did it! Now TM0 does not affect TM1. A month ago I did not know S. As it turned out, this is not a problem. Thank you Martin. You helped. Indeed, Flowcode is a flexible system. You just need to learn to adapt this environment to your tasks.
Best regards, Petro
Best regards, Petro
- Mon Jan 06, 2025 11:02 pm
- Forum: Feature Requests
- Topic: PWM + Сapture + Сomparison
- Replies: 36
- Views: 15942
Re: PWM + Сapture + Сomparison
if(PIR1=0b000100) //it works like that too . if (CCP1IF) //this works too I have done everything you recommend more than once. Capture works great until TMR0 is added to the program body. And then TMR0 interrupts somehow magically penetrate TMR1, thereby distorting measurements. Microchip recommends...
- Mon Jan 06, 2025 4:37 pm
- Forum: Feature Requests
- Topic: PWM + Сapture + Сomparison
- Replies: 36
- Views: 15942
Re: PWM + Сapture + Сomparison
Believe me, I tried different options. Even this one. Without ";" if(PIR1 & (1 << CCP1IF)) // You wrote about this before. And this option if (PIR1=0b00000100) //Check if the CCP1 interrupt flag is set { FCM_%n(); //read int in body PIR1bits.CCP1IF = 0; // Clear interrupt flag } // The...
- Mon Jan 06, 2025 11:28 am
- Forum: Feature Requests
- Topic: PWM + Сapture + Сomparison
- Replies: 36
- Views: 15942
Re: PWM + Сapture + Сomparison
Hi Martin! My joy is premature. if (PIR1bits.CCP1IF) //bad.Flowcode doesn't understand this. TMR0 interrupts affect CCP capture. My 65 are in no hurry to cooperate with the C language. However, in a couple of weeks I understand something thanks to you Martin. I noticed that a program in pure C and i...
- Sat Jan 04, 2025 7:31 pm
- Forum: Feature Requests
- Topic: PWM + Сapture + Сomparison
- Replies: 36
- Views: 15942
Re: PWM + Сapture + Сomparison
Again my inattention. I understood what you were talking about and found the error. if (PIR1bits.CCP1IF); is nothing. It should be if(PIR1 & (1 << CCP1IF));//CCP1 interrupt capture event occurred if flag CCP1IF=1 in PIR1. You wrote about this. Now TMR0 is in action. Thank you. Best regards Peter
- Sat Jan 04, 2025 3:03 pm
- Forum: Feature Requests
- Topic: PWM + Сapture + Сomparison
- Replies: 36
- Views: 15942
Re: PWM + Сapture + Сomparison
Flowcode understands this as reading bit M0 in the register of the CCP1CON
- Sat Jan 04, 2025 8:15 am
- Forum: Feature Requests
- Topic: PWM + Сapture + Сomparison
- Replies: 36
- Views: 15942
Re: PWM + Сapture + Сomparison
Happy New Year! It looks like I got what I wanted. But there is one big problem. If you look at my example lowcode implementation of capture you will see that I blocked the TMR0 component because it affects the CCP interrupts. However, I need TMR0 in the main program. How to get rid of the influence...