casemod
Member level 1
- Joined
- Sep 21, 2013
- Messages
- 34
- Helped
- 1
- Reputation
- 2
- Reaction score
- 1
- Trophy points
- 1,288
- Activity points
- 1,618
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: