Skip to content

Commit ae86fba

Browse files
committed
MPAE-15106: Grammar edits
1 parent 43988ef commit ae86fba

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

README.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
# User Interface Co-Processor with PIC16F18146
66

7-
This example uses the PIC16F18146 to act as a user-interface co-processor, where the MCU debounces a pushbutton, performs quadrature decoding, and generates 4 programmable PWM channels. As the functionality of this example is developed in software, it can be customized to the design.
7+
This example uses the PIC16F18146 to work as a user-interface co-processor, where the MCU debounces a push button, performs quadrature decoding, and generates 4 programmable PWM channels. As the functionality of this example is developed in software, it can be customized to the design.
88

99
## Related Documentation
1010

@@ -30,7 +30,7 @@ This example uses the PIC16F18146 to act as a user-interface co-processor, where
3030

3131
## Setup
3232

33-
With the power off, install the PIC16F18146 into the socket of the Curiosity LPC board, while matching the pin 1 marker on the DIP and PCB (marked as 1).
33+
Disconnect power to the LPC board. Install the PIC16F18146 into the socket of the Curiosity LPC board, while matching pin 1 on the DIP and PCB (indicated by the 1 in the image below).
3434

3535
![Curiosity LPC](./images/LPC.png)
3636

@@ -42,9 +42,9 @@ With the power off, install the PIC16F18146 into the socket of the Curiosity LPC
4242
| RB6 | SDA, I<sup>2</sup>C Data Line
4343
| GND | Connect the ground of the MCP2221A to the LPC board.
4444

45-
*Important: Match the voltage of the MCP2221A breakout to the setting on the Curiosity LPC (marked as 2). Either +5V or 3.3V can be used, depending on the circuit requirements. Do NOT connect power from the MCP2221A to the LPC.*
45+
*Important: Match the voltage of the MCP2221A breakout to the setting on the Curiosity LPC, marked as 2. Either +5V or 3.3V can be used, depending on the circuit requirements. Do NOT connect power from the MCP2221A to the LPC.*
4646

47-
Next, follow the application circuit of the encoder (if provided), and connect the encoder as follows.
47+
If provided, follow the application circuit of the encoder, and connect the encoder as follows.
4848

4949
| IO Pin | Description
5050
| ------ | ----------
@@ -57,11 +57,11 @@ Next, follow the application circuit of the encoder (if provided), and connect t
5757

5858
### Built-In (Pre-wired) Features
5959

60-
For the pushbutton, the button built-in to the LPC is used (S1). No wiring is required. Pin RC6 is the debounced output, which is viewable on an oscilloscope.
60+
No wiring is required for the push button built-in to the LPC (S1). Pin RC6 is a debounced output that can be viewed on an oscilloscope.
6161

6262
| IO Pin | Description
6363
| ------ | ----------
64-
| RC4 | Pushbutton Input (S1)
64+
| RC4 | Push button Input (S1)
6565
| RC6 | Debounced Output (*Optional, Connect to oscilloscope with ground for testing*)
6666

6767
*Note: It was difficult to generate any bounces from S1. Bounces can be easily generated by connecting a piece of wire to RC4 and tapping it on a grounded pin or connection.*
@@ -83,7 +83,7 @@ To demonstrate the PWM controls, the LEDs on the LPC are connected to the output
8383
| RB6 | SDA, I<sup>2</sup>C Data Line
8484
| RC0 | Quadrature Decoder "A" Input
8585
| RC1 | Quadrature Decoder "B" Input
86-
| RC4 | Pushbutton Input (S1)
86+
| RC4 | Push button Input (S1)
8787
| RC6 | Debounced Output (*Optional, Connect to oscilloscope with ground for testing*)
8888
| RC5 | PWM_CH1 (PWM1, Phase 1)
8989
| RA2 | PWM_CH2 (PWM1, Phase 2)
@@ -97,7 +97,7 @@ This application implements a simple user-interface co-processor for an embedded
9797
This proof-of-concept project implements 3 key functions for the main processor:
9898
- Decoding quadrature signals from rotary encoders
9999
- Generating 4 PWM waveforms
100-
- Debouncing a pushbutton
100+
- Debouncing a push button
101101

102102
As this application is software defined, the exact functionality can be customized to meet the requirements of the system.
103103

@@ -123,7 +123,7 @@ The PWM waveforms are generated by Core Independent Peripherals (CIP), which ope
123123

124124
### Debouncing a Button
125125

126-
Pushbuttons and switches exhibit a temporary "bounce" when pressed or released. These bounces create brief periods of instability that would confuse the system if not filtered out.
126+
Push buttons and switches exhibit a temporary "bounce" when pressed or released. These bounces create brief periods of instability that would confuse the system if not filtered out.
127127

128128
In this example, a hardware-level button debouncer is implemented using hardware peripherals. To implement this functionality, 2 CLCs and the Numerically Controlled Oscillator (NCO) CIPs are used. The NCO generates a low-frequency clock (200 Hz) for the CLCs, while the CLCs perform basic digital filtering, as shown below.
129129

@@ -135,13 +135,13 @@ In this example, a hardware-level button debouncer is implemented using hardware
135135

136136
### I<sup>2</sup>C Interface
137137

138-
To communicate with the device, I<sup>2</sup>C is used. This device is setup as an I<sup>2</sup>C client with an address of 0x40. (The address can be changed in software).
138+
This device is setup as an I<sup>2</sup>C Client with an address of 0x40. (The address can be changed in software).
139139

140-
When I<sup>2</sup>C is not active, the device is in sleep to save power.
140+
When the I<sup>2</sup>C is not active, the device goes into Sleep mode to save power.
141141

142142
#### Writing Data
143143

144-
To configure the device, perform an I<sup>2</sup>C write to the device. Writes take the form as:
144+
Perform an I<sup>2</sup>C write for the device to configure it, as shown in the example below:
145145

146146
![I2C Write Example](./images/i2cWrite.png)
147147

@@ -164,27 +164,27 @@ A list of the virtual registers is shown below.
164164

165165
#### Reading Data
166166

167-
To get the net change from the quadrature decider, perform an I<sup>2</sup>C read. The bytes read from the device are in int16_t format, with the 1st byte being the high byte, and the 2nd byte being the low byte. An example is shown below, with 2 back-to-back reads:
167+
To get the net change from the quadrature decoder, perform an I<sup>2</sup>C read. The bytes read from the device are in int16_t format, with the 1st byte being the high byte and the 2nd byte being the low byte. An example is shown below, with 2 back-to-back reads:
168168

169169
![I2C Read Example](./images/i2cRead.png)
170170

171171
*Note: The application automatically zeros the net change after each read.*
172172

173-
When the high-byte is read, the microcontroller computes the net rotation. This ensures the value doesn't rollover while a read is happening. After the low-byte, the system will repeat the operation above, but with the net rotation since the last read.
173+
When the high byte is read, the microcontroller computes the net rotation. This ensures the value doesn't rollover while a read is performed. After the low byte, the system will repeat the operation above, but with the net rotation since the last read.
174174

175-
*Note: Very long byte read sequences with the MCP2221A seem to fail, likely due to insufficent clock stretching time for the client. Be sure to give the device time to respond.*
175+
*Note: Very long byte read sequences with the MCP2221A seem to fail, likely due to insufficent clock stretching time for the Client. Time must be given for the device to respond.*
176176

177177
#### Setting Up PWM
178178

179179
For each channel of PWM, there is an associated period and duty cycle register. These settings can be set independently of each other, or at the same time. The PWM is internally loaded and started at the same time to keep the channels as synchronized as possible.
180180

181181
**Note: Setting the channels to differing frequencies is likely to break synchronization.**
182182

183-
Consult the PWM chapter of the datasheet for more information about the PWM.
183+
Consult the PWM chapter of the data sheet for more information about the PWM.
184184

185185
##### Frequency Setup
186186

187-
The PWM Core Independent Peripheral (CIP) generate 2 outputs for each instance of the peripheral. These instances share the same frequency, but different duty cycles. The period register determines the max count in the PWM timer. For instance, setting a period of 10, would limit the count to 10 or less. Each time the clock source (LFINTOSC, 31 kHz) goes high, the counter increments.
187+
The PWM CIP generates 2 outputs for each peripheral. These outputs share the same frequency, but can have differing duty cycles. The period register determines the max count in the PWM timer. For instance, setting a period of 10 would limit the count to 10 or less. Each time the clock source (LFINTOSC, 31 kHz) goes high, the counter increments.
188188

189189
To determine the value to write for a given frequency, divide the clock source frequency by the desired target. As an example, if the desired output was 100 Hz, then write 310 (0x01, 0x36) to the register.
190190

0 commit comments

Comments
 (0)