· Vdd which is the typical power supply for CMOS ICs.
· Vss is ground.
· AVdd is the supply for the analog circuits (ADC)
· VCAP is for the internal voltage regulator. The core of the chip actually runs at a lower voltage than the IO and the chip has a built in regulator for the core. Vdd is 3.3 volts but the internal voltage is 1.8 volts. This allows for lower power at higher switching frequencies.
More on the internal regulator is given in the the document http://ww1.microchip.com/downloads/en/DeviceDoc/60001168J.pdf
See
eevblog reference listed above gives suggested circuit for getting started.
Power for the Microstick II is normally supplied from a computer USB port.
http://ww1.microchip.com/downloads/en/DeviceDoc/21999b.pdf
http://www.microchip.com/wwwproducts/en/MCP1727
http://ww1.microchip.com/downloads/en/DeviceDoc/DS-52012A.pdf
http://www.microchip.com/forums/m638531.aspx
See http://hackaday.com/2015/12/21/microcontroller-lectures-by-bruce-land/
Obtained the book June 10, 2016.
main() { ANSELA =0; //make sure analog is cleared ANSELB = 0; mPORTAClearBits(BIT_0); //Clear bits to ensure light is off. mPORTASetPinsDigitalOut(BIT_0); //Set port as output while (1) { delay(); PORTToggleBits(IOPORT_A,BIT_0); } }
Simplified example using only fprint() to send data to uart2. Created variables to count passage of minutes and seconds.
#pragma config FWDTEN = OFF // Watchdog Timer Enable (WDT Disabled (SWDTEN Bit Controls))
printf("* %4im %2is\r\n", minutes, seconds);
Using UART plib.h functions to set up UART
UARTConfigure(UART2, UART_ENABLE_PINS_TX_RX_ONLY); UARTSetLineControl(UART2, UART_DATA_SIZE_8_BITS | UART_PARITY_NONE | UART_STOP_BITS_1); UARTSetDataRate(UART2, GetPeripheralClock(), BaudRate); UARTEnable(UART2, UART_ENABLE_FLAGS(UART_PERIPHERAL | UART_RX | UART_TX));