dsPIC® DSCs Implementation Operations

The first operation is to set the two pointers to point at the first location of each buffer in the RAM. W8 in the following diagram is the pointer to the coefficients buffer; W10 is the pointer to the error buffer.

The new error value is computed as the difference between the reference voltage (Vref) and the new output voltage read by the ADC (ADCBUF1). See figure below.

movsac Instruction

The movsac instruction performs a number of different tasks. The following diagram and steps demonstrate the movsac instruction.

1

Move RAM contents

1a: Moves the content of the RAM location pointed by W8 into register W4.1b: Moves the content of the RAM location pointed by W10 into register W5.

2

Update Working Registers

2a: Updates the W8 register, so that it is now pointing to the following RAM location.2b: Updates the W10 register, so that it is now pointing to the following RAM location.

PID term computation

Below are the computation steps of the first term of the PID:

1

The W4 and W5 registers content are multiplied and the result is added to the 40-bit accumulator B.

2

Moves the content of the RAM location pointed by W8 into register W4.

3

Moves the content of the RAM location pointed by W10 into register W5.

4

Updates the W8 register, so that it is now pointing to the following RAM location.

5

Updates the W10 register, so that it is now pointing to the following RAM location.

6

The W4 and W5 registers content are multiplied and the result is added to the 40-bit accumulator B.

Information contained on this site regarding device applications and the like is provided only for your convenience and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use. Use of Microchip devices in life support and/or safety applications is entirely at the buyer's risk, and the buyer agrees to defend, indemnify and hold harmless Microchip from any and all damages, claims, suits, or expenses resulting from such use. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual property rights.

Click here to edit contents of this page.

Click here to toggle editing of individual sections of the page (if possible). Watch headings for an "edit" link when available.

Append content without editing the whole page source.

Check out how this page has evolved in the past.

If you want to discuss contents of this page - this is the easiest way to do it.

View and manage file attachments for this page.

A few useful tools to manage this Site.

See pages that link to and include this page.

Change the name (also URL address, possibly the category) of the page.