|
|
View previous topic :: View next topic |
Author |
Message |
allenhuffman
Joined: 17 Jun 2019 Posts: 537 Location: Des Moines, Iowa, USA
|
|
Posted: Thu Mar 12, 2020 11:26 am |
|
|
gaugeguy wrote: | When you have several different 'lettered' outputs, look at the CCP_PULSE_STEERING_x to determine which output it gets directed to.
Refer to the processor .h file |
Ah. Was my issue here that there were TWO CCP2s and this the #use couldn’t tell which one? _________________ Allen C. Huffman, Sub-Etha Software (est. 1990) http://www.subethasoftware.com
Embedded C, Arduino, MSP430, ESP8266/32, BASIC Stamp and PIC24 programmer.
http://www.whywouldyouwanttodothat.com ? |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19215
|
|
Posted: Thu Mar 12, 2020 12:29 pm |
|
|
The #USE PWM, is a powerful tool, but comes at a very large cost. It
removes direct control of what resources are actually used. The timing
controls produce bulky code, and you are having to 'guess' what
resources are actually use.
If prototyping and I want a frequency quickly, I'll use #USE, but as soon
as I want to use explicit resources I'll switch to controlling things myself.
This way I can assign the resources and know what hardware is used.
It's a 'shortcut', but equivalent to one that takes you straight across
a bog.... |
|
|
allenhuffman
Joined: 17 Jun 2019 Posts: 537 Location: Des Moines, Iowa, USA
|
|
Posted: Fri Mar 13, 2020 8:11 am |
|
|
Ttelmah wrote: | The #USE PWM, is a powerful tool, but comes at a very large cost. It
removes direct control of what resources are actually used. The timing
controls produce bulky code, and you are having to 'guess' what
resources are actually use.
If prototyping and I want a frequency quickly, I'll use #USE, but as soon
as I want to use explicit resources I'll switch to controlling things myself.
This way I can assign the resources and know what hardware is used.
It's a 'shortcut', but equivalent to one that takes you straight across
a bog.... |
Thanks -- good to know. I was experimenting with it this morning and that left me with more questions than answers.
I do like that it calculates everything for me (prescaler).
I have successfully used PWM on our speaker to play music, and hardware is going to swap two pins for me so I can test that on the backlight.
I am now trying to move the other two timers to just Timer 1. We need a 32-bit counter for hardware being added to the board, soon. _________________ Allen C. Huffman, Sub-Etha Software (est. 1990) http://www.subethasoftware.com
Embedded C, Arduino, MSP430, ESP8266/32, BASIC Stamp and PIC24 programmer.
http://www.whywouldyouwanttodothat.com ? |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19215
|
|
Posted: Fri Mar 13, 2020 8:51 am |
|
|
Remember 'input capture' can again support using it's own internal
counters. |
|
|
allenhuffman
Joined: 17 Jun 2019 Posts: 537 Location: Des Moines, Iowa, USA
|
|
Posted: Wed Mar 18, 2020 10:47 am |
|
|
Ttelmah wrote: | Remember 'input capture' can again support using it's own internal
counters. |
Is there an example of this somewhere? _________________ Allen C. Huffman, Sub-Etha Software (est. 1990) http://www.subethasoftware.com
Embedded C, Arduino, MSP430, ESP8266/32, BASIC Stamp and PIC24 programmer.
http://www.whywouldyouwanttodothat.com ? |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19215
|
|
Posted: Thu Mar 19, 2020 1:10 am |
|
|
On the setup_capture, just use 'CAPTURE_SYSTEM_CLOCK'. This then
makes the capture unit clock from the system clock using it's own internal
counter. |
|
|
|
|
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
|