casemod
Member level 1
Code Writing - Frequency calculation for dsPIC
I need to set up the input capture peripheral on a PIC 33F using ASM language.
The objective is to convert a 0 to 1400Hz frequency from an external pin into a 11bit variable ranging from 0b0000000000 to 0b10101000110, however this needs to be calculated on a pulse by pulse basis (period between pulses) as to have a higher refresh rate at lower revs.
**broken link removed**
Attached is the code. Line 128 was set with a dummy 11 bit variable that sets the frequency to 150.8hz.
The resulting variable From the frequency calculation should replace this.
I need to set up the input capture peripheral on a PIC 33F using ASM language.
The objective is to convert a 0 to 1400Hz frequency from an external pin into a 11bit variable ranging from 0b0000000000 to 0b10101000110, however this needs to be calculated on a pulse by pulse basis (period between pulses) as to have a higher refresh rate at lower revs.
**broken link removed**
Attached is the code. Line 128 was set with a dummy 11 bit variable that sets the frequency to 150.8hz.
The resulting variable From the frequency calculation should replace this.
Last edited: