Skip to content

Commit fb0318a

Browse files
authored
dPIC33A freeRTOS demo updated to work with latest DFP's (#21)
* Made the code compatible with latest DFPs * Updated README
1 parent f2c7a6f commit fb0318a

File tree

11 files changed

+865
-866
lines changed

11 files changed

+865
-866
lines changed

PIC24_DSPIC_MPLABX/Demo/dspic33a-freertos-demo/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ http://www.freertos.org/FAQHelp.html
3232

3333
## Software Used
3434

35-
- MPLAB® X IDE v6.20.0 or newer (https://www.microchip.com/mplabx)
36-
- MPLAB® XC-DSC v3.10.0 or newer (https://www.microchip.com/xcdsc)
35+
- MPLAB® X IDE v6.20 or newer (https://www.microchip.com/mplabx)
36+
- MPLAB® XC-DSC v3.20 or newer (https://www.microchip.com/xcdsc)
3737
- Any of the serial terminal application. Example: Tera Term (https://ttssh2.osdn.jp/index.html.en)
3838

3939

PIC24_DSPIC_MPLABX/Demo/dspic33a-freertos-demo/dspic33a-freertos-demo.X/nbproject/configurations.xml

Lines changed: 841 additions & 841 deletions
Large diffs are not rendered by default.

PIC24_DSPIC_MPLABX/Demo/dspic33a-freertos-demo/serial/serial.c

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -95,23 +95,22 @@ xComPortHandle xSerialPortInitMinimal( unsigned long ulWantedBaud, unsigned port
9595
#endif
9696

9797
/* Setup the UART. */
98-
U2CONbits.BRGH = serLOW_SPEED;
98+
U2CONbits.BRGS = serLOW_SPEED;
9999
U2CONbits.STP = serONE_STOP_BIT;
100100
U2CONbits.ABDEN = serAUTO_BAUD_OFF;
101-
U2CONbits.WAKE = serWAKE_UP_DISABLE;
101+
U2CONbits.WUE = serWAKE_UP_DISABLE;
102102
U2CONbits.FLO = serNO_HARDWARE_FLOW_CONTROL;
103103
U2CONbits.MODE = serNO_IRDA;
104104
U2CONbits.SIDL = serCONTINUE_IN_IDLE_MODE;
105105
U2CONbits.ON = serUART_ENABLED;
106106

107107
U2BRG = (unsigned short)(( (float)configCPU_CLOCK_HZ / ( (float)16 * (float)ulWantedBaud ) ) - (float)0.5);
108108

109-
U2STAbits.URXISEL = serINTERRUPT_ON_SINGLE_CHAR;
110109
U2CONbits.RXEN = serRX_ENABLE;
111110
U2CONbits.TXEN = serTX_ENABLE;
112-
U2CONbits.UTXINV = serNORMAL_IDLE_STATE;
113-
U2STAbits.TXWM = serINTERRUPT_ON_SINGLE_CHAR;
114-
U2STAbits.RXWM = serINTERRUPT_ON_SINGLE_CHAR;
111+
U2CONbits.TXPOL = serNORMAL_IDLE_STATE;
112+
U2STATbits.TXWM = serINTERRUPT_ON_SINGLE_CHAR;
113+
U2STATbits.RXWM = serINTERRUPT_ON_SINGLE_CHAR;
115114

116115

117116

@@ -128,7 +127,7 @@ xComPortHandle xSerialPortInitMinimal( unsigned long ulWantedBaud, unsigned port
128127
IEC2bits.U2RXIE = serINTERRUPT_ENABLE;
129128

130129
/* Clear the Rx buffer. */
131-
while( U2STAbits.RXBE == serCLEAR_FLAG )
130+
while( U2STATbits.RXBE == serCLEAR_FLAG )
132131
{
133132
cChar = U2RXB;
134133
}
@@ -194,7 +193,7 @@ portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
194193
If the post causes a task to wake force a context switch as the woken task
195194
may have a higher priority than the task we have interrupted. */
196195
IFS2bits.U2RXIF = serCLEAR_FLAG;
197-
while( !U2STAbits.RXBE )
196+
while( !U2STATbits.RXBE )
198197
{
199198
cChar = U2RXB;
200199
xQueueSendFromISR( xRxedChars, &cChar, &xHigherPriorityTaskWoken );
@@ -216,7 +215,7 @@ portBASE_TYPE xTaskWoken = pdFALSE;
216215
Another interrupt will occur the next time there is space so this does
217216
not matter. */
218217
IFS2bits.U2TXIF = serCLEAR_FLAG;
219-
while( !( U2STAbits.UTXBF ) )
218+
while( !( U2STATbits.TXBF ) )
220219
{
221220
if( xQueueReceiveFromISR( xCharsForTx, &cChar, &xTaskWoken ) == pdTRUE )
222221
{

PIC24_DSPIC_MPLABX/Demo/dspic33a-freertos-demo/traps.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ inline static void use_failsafe_stack(void)
8484
/** Bus error.**/
8585
void ERROR_HANDLER _BusErrorTrap(void)
8686
{
87-
INTCON3bits.BET2 = 0; //Clear the trap flag
87+
INTCON3bits.DMABET = 0; //Clear the trap flag
8888
TRAPS_halt_on_error(TRAPS_DMA_BUS_ERR);
8989
}
9090

PIC24_DSPIC_MPLABX/Demo/dspic33c-client-freertos-demo/client/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ http://www.freertos.org/FAQHelp.html
3232

3333
## Software Used
3434

35-
- MPLAB® X IDE v6.20.0 or newer (https://www.microchip.com/mplabx)
36-
- MPLAB® XC-DSC v3.10.0 or newer (https://www.microchip.com/xcdsc)
35+
- MPLAB® X IDE v6.20 or newer (https://www.microchip.com/mplabx)
36+
- MPLAB® XC-DSC v3.20 or newer (https://www.microchip.com/xcdsc)
3737
- Any of the serial terminal application. Example: Tera Term (https://ttssh2.osdn.jp/index.html.en)
3838

3939

PIC24_DSPIC_MPLABX/Demo/dspic33c-client-freertos-demo/host/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ http://www.freertos.org/FAQHelp.html
3232

3333
## Software Used
3434

35-
- MPLAB® X IDE v6.20.0 or newer (https://www.microchip.com/mplabx)
36-
- MPLAB® XC-DSC v3.10.0 or newer (https://www.microchip.com/xcdsc)
35+
- MPLAB® X IDE v6.20 or newer (https://www.microchip.com/mplabx)
36+
- MPLAB® XC-DSC v3.20 or newer (https://www.microchip.com/xcdsc)
3737
- Any of the serial terminal application. Example: Tera Term (https://ttssh2.osdn.jp/index.html.en)
3838

3939

PIC24_DSPIC_MPLABX/Demo/dspic33c-host-freertos-demo/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ http://www.freertos.org/FAQHelp.html
3232

3333
## Software Used
3434

35-
- MPLAB® X IDE v6.20.0 or newer (https://www.microchip.com/mplabx)
36-
- MPLAB® XC-DSC v3.10.0 or newer (https://www.microchip.com/xcdsc)
35+
- MPLAB® X IDE v6.20 or newer (https://www.microchip.com/mplabx)
36+
- MPLAB® XC-DSC v3.20 or newer (https://www.microchip.com/xcdsc)
3737
- Any of the serial terminal application. Example: Tera Term (https://ttssh2.osdn.jp/index.html.en)
3838

3939

PIC24_DSPIC_MPLABX/Demo/dspic33e-freertos-demo/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ http://www.freertos.org/FAQHelp.html
3232

3333
## Software Used
3434

35-
- MPLAB® X IDE v6.20.0 or newer (https://www.microchip.com/mplabx)
36-
- MPLAB® XC-DSC v3.10.0 or newer (https://www.microchip.com/xcdsc)
35+
- MPLAB® X IDE v6.20 or newer (https://www.microchip.com/mplabx)
36+
- MPLAB® XC-DSC v3.20 or newer (https://www.microchip.com/xcdsc)
3737
- Any of the serial terminal application. Example: Tera Term (https://ttssh2.osdn.jp/index.html.en)
3838

3939

PIC24_DSPIC_MPLABX/Demo/dspic33f-freertos-demo/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ http://www.freertos.org/FAQHelp.html
3232

3333
## Software Used
3434

35-
- MPLAB® X IDE v6.20.0 or newer (https://www.microchip.com/mplabx)
36-
- MPLAB® XC-DSC v3.10.0 or newer (https://www.microchip.com/xcdsc)
35+
- MPLAB® X IDE v6.20 or newer (https://www.microchip.com/mplabx)
36+
- MPLAB® XC-DSC v3.20 or newer (https://www.microchip.com/xcdsc)
3737
- Any of the serial terminal application. Example: Tera Term (https://ttssh2.osdn.jp/index.html.en)
3838

3939

PIC24_DSPIC_MPLABX/Demo/pic24-freertos-demo/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ http://www.freertos.org/FAQHelp.html
3232

3333
## Software Used
3434

35-
- MPLAB® X IDE v6.0.0 or newer (https://www.microchip.com/mplabx)
36-
- MPLAB® XC16 v2.0.0 or newer (https://www.microchip.com/xc)
35+
- MPLAB® X IDE v6.0 or newer (https://www.microchip.com/mplabx)
36+
- MPLAB® XC16 v2.0 or newer (https://www.microchip.com/xc)
3737
- Any of the serial terminal application. Example: Tera Term (https://ttssh2.osdn.jp/index.html.en)
3838

3939

0 commit comments

Comments
 (0)