PIC24 Support Libraries
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
pic24_libconfig.h File Reference
#include <xc.h>

Go to the source code of this file.

Macros

Supported hardware platforms

This library supports the following hardware platforms. More can easily be added.

#define EXPLORER16_100P   0
 
#define DANGEROUS_WEB   1
 
#define STARTER_BOARD_28P   2
 
#define DEFAULT_DESIGN   3
 
#define HARDMAPPED_UART   4
 
#define MICROSTICK2   5
 
#define EMBEDDED_C1   472313
 
#define EMBEDDED_F14   472314
 
#define HARDWARE_PLATFORM   DEFAULT_DESIGN
 
Defines configuring pic24_clockfreq.h
#define CLOCK_CONFIG   FRCPLL_FCY40MHz
 
Defines configuring pic24_delay.h
#define DEBOUNCE_DLY   15
 
outString() end-of-line behavior in pic24_serial.h
#define SERIAL_EOL_CR_LF   0
 
#define SERIAL_EOL_CR   1
 
#define SERIAL_EOL_LF   2
 
#define SERIAL_EOL_DEFAULT   SERIAL_EOL_LF
 
Defines from pic24_serial.h
#define DEFAULT_UART   1
 
#define DEFAULT_BAUDRATE   230400
 
#define DEFAULT_BRGH   0
 
Defines configuring pic24_util.h
#define USE_CLOCK_TIMEOUT   1
 
#define USE_HEARTBEAT   1
 
#define HB_LED   _LATB15
 
#define CONFIG_HB_LED()   CONFIG_RB15_AS_DIG_OUTPUT()
 

Detailed Description

This file consolidates all the user-configurable #defines scattered throughout the PIC24 support library. These may be changed by editing the #defines below, or by defining them via passing a -Dname=value flag to the compiler.

Definition in file pic24_libconfig.h.

Macro Definition Documentation

#define CLOCK_CONFIG   FRCPLL_FCY40MHz

Clock configuration for the PIC24 - set CLOCK_CONFIG to one of the following. Naming convention is OSCTYPE_[PRIFREQ]_FCYFREQ where OSCTYPE gives the oscillator type (see FNOSC_SEL for details), the optional PRIFREQ specifies primary oscillator frequency, and FCYFREQ determiens the processor clock (FCY) frequency. The "#defines for CLOCK_CONFIG" section gives the definition of the values below.

Name uP
SIM_CLOCK (simulator) any
FRCPLL_FCY16MHz PIC24F, PIC24FK
FRC_FCY4MHz PIC24F, PIC24FK
PRI_NO_PLL_7372KHzCrystal PIC24F, PIC24FK, PIC24H, dsPIC33F
FRC_FCY3685KHz PIC24H, dsPIC33F, PIC24E, dsPIC33E
FRCPLL_FCY40MHz PIC24H, dsPIC33F
PRIPLL_7372KHzCrystal_40MHzFCY PIC24H, dsPIC33F
PRIPLL_8MHzCrystal_40MHzFCY PIC24H, dsPIC33F, PIC24E, dsPIC33E
PRIPLL_8MHzCrystal_16MHzFCY PIC24F, PIC24FK
PRI_8MHzCrystal_4MHzFCY PIC24F, PIC24FK, PIC24H, dsPIC33F
FRCPLL_FCY60MHz PIC24E, dsPIC33E
FRCPLL_FCY70MHz PIC24E, dsPIC33E (limited temp. range)

Definition at line 195 of file pic24_libconfig.h.

#define CONFIG_HB_LED ( )    CONFIG_RB15_AS_DIG_OUTPUT()

Define a config function for the heartbeat pin.

Definition at line 375 of file pic24_libconfig.h.

Referenced by configHeartbeat().

#define DANGEROUS_WEB   1

The Dangerous Prototypes web platform. See http://dangerousprototypes.com/docs/Web_platform_hardware_design

Definition at line 59 of file pic24_libconfig.h.

#define DEBOUNCE_DLY   15

Define a debounce delay for use in reading pushbutton switches. The value is specified in milliseconds.

Definition at line 218 of file pic24_libconfig.h.

#define DEFAULT_BAUDRATE   230400

Default baud rate used by configBasic() to configure the DEFAULT_UART.

Definition at line 300 of file pic24_libconfig.h.

Referenced by configBasic().

#define DEFAULT_BRGH   0

Default BRGH value used by configUART1 to 4 when configuring a UART. This value may be overridden on a per-UART basis by #defineing DEFAULT_BRGHn (where n = the UART to override) to the values given below. Allowed values:

  • BRGH = 0 - the baud rate divisor is 16
  • BRGH = 1 - the baud rate divisor is 4

Definition at line 313 of file pic24_libconfig.h.

#define DEFAULT_DESIGN   3

Any of three targets, which share the same hardware configuration:

  1. The schematic on pg. 255 of the book "Microcontrollers: From Assembly Language to C Using the PIC24 Family"
  2. The Microchip Microstik for dsPIC33F and PIC24H Development Board, part number DM330013.
  3. The Sparkfun Breakout Board for PIC24HJ32 - mini-Bully sku: BOB-08787

Definition at line 78 of file pic24_libconfig.h.

#define DEFAULT_UART   1

Defines the default UART which the configUART() function initializes and which serial I/O is directed to until the _C30_UART variable is changed.

Definition at line 275 of file pic24_libconfig.h.

Referenced by configDefaultUART().

#define EMBEDDED_C1   472313

The CAN2 rev C1 board used for Embedded Systems, ECE 4723, at Mississippi State University (Fall 2013)

Definition at line 99 of file pic24_libconfig.h.

#define EMBEDDED_F14   472314

The CAN2 rev C1 board used for Embedded Systems, ECE 4723, at Mississippi State University (Fall 2014)

Definition at line 102 of file pic24_libconfig.h.

#define EXPLORER16_100P   0

The Microchip Explorer 16 Development Board with a 100-pin plug-in module, part number DM240001.

Definition at line 54 of file pic24_libconfig.h.

#define HARDMAPPED_UART   4

A device with hard-mapped pins for UART TX and RX.

Definition at line 81 of file pic24_libconfig.h.

#define HARDWARE_PLATFORM   DEFAULT_DESIGN

Select one of the hardware platform above to compile for.

Definition at line 106 of file pic24_libconfig.h.

#define HB_LED   _LATB15

Choose a pin for the heartbeat. If USE_HEARTBEAT is false, the heartbeat is disabled.

Definition at line 366 of file pic24_libconfig.h.

Referenced by configHeartbeat(), and toggleHeartbeat().

#define MICROSTICK2   5

Microchip part number: dm330013-2

Microstick II delivers a complete development hardware platform for Microchip’s 16-bit and 32-bit microcontrollers and digital signal controllers. It’s the perfect solution to those looking for a low-cost, easy-to-use development platform. The USB-powered kit includes an on-board debugger/programmer, a DUT socket for easy device swapping, a user LED and reset button. It is designed for insertion into a standard prototyping board for easy connection to additional circuitry. The kit is extremely portable as well and is still about the size of a stick of gum!

Supported Parts: All 3.3V PIC24FJ, PIC24E, PIC24H, dsPIC33, and PIC32 28-pin SPDIP packaged devices.

Definition at line 96 of file pic24_libconfig.h.

#define SERIAL_EOL_CR   1

Set SERIAL_EOL_DEFAULT to this value to send a carriage return only ("\r") to end a line.

Definition at line 238 of file pic24_libconfig.h.

#define SERIAL_EOL_CR_LF   0

Set SERIAL_EOL_DEFAULT to this value to send a CR with every LF in outString. PuTTY uses this, expects "\n\r".

Definition at line 233 of file pic24_libconfig.h.

#define SERIAL_EOL_DEFAULT   SERIAL_EOL_LF

This macro defines end-of-line output behavior when the outString() function is passed a new line ("\n"). Set this to either SERIAL_EOL_CR_LF, SERIAL_EOL_CR, or SERIAL_EOL_LF.

Definition at line 253 of file pic24_libconfig.h.

#define SERIAL_EOL_LF   2

Set SERIAL_EOL_DEFAULT to this value to sends a new line only ("\n"). This works for Bully Bootloader, MPLAB SIM, TeraTerm, RealTerm.

Definition at line 245 of file pic24_libconfig.h.

#define STARTER_BOARD_28P   2

The Microchip 16-bit 28-pin Starter Board, Part number DM300027. Thanks to István for contributing this!

Note: When you use a Microchip 16-bit 28-pin Starter Board with this library collection or just try out the example programs of the texbook, the SW2 switch shoud be set in the USB/debug state.

Definition at line 68 of file pic24_libconfig.h.

#define USE_CLOCK_TIMEOUT   1

When set to 1, verify that calls to switchClock() do successfully switch the clock, reporting an error message on failure. See also checkClockTimeout().

Definition at line 334 of file pic24_libconfig.h.

#define USE_HEARTBEAT   1

If this macro is true, heartbeat functionality is enabled. If false, heartbeat is disabled.

Definition at line 348 of file pic24_libconfig.h.