#include <pic16f1827.h>
#define RUNAT32MHZ /* else 16 MHz */
-#define LEDBIT 0x01 /* PORTB.3 */
+#define LEDBIT 0x01 /* PORTB.0 */
#if defined(RUNAT32MHZ)
__CONFIG(WDTE_OFF & FOSC_INTOSC);
void pwm_init()
{
- /* Initialize PWM on PORTB.0
+ /* Initialize PWM on PORTB.3
* - Fosc = 32MHz
* - Prescale = 16
* - PRx value = 0xff
* = f(pwm) = 1.95 kHz
*/
- /* Disable output on PORTB.0 */
+ /* Disable output on PORTB.3 */
TRISB |= 0x08;
/* Configure ECCP1 */
PR2 = 0xff;
T2CON = 0b00000111;
- /* Enable PWM output, PORTB.0 */
+ /* Enable PWM output, PORTB.3 */
while (!TMR2IF); /* wait until timer overflow */
TRISB &= ~0x08;
}
void led_init()
{
- PORTB &= ~LEDBIT; /* Led is PORTB.3 */
+ PORTB &= ~LEDBIT; /* Led is PORTB.0 */
TRISB &= ~LEDBIT;
}
<?xml version="1.0" encoding="UTF-8"?>
<project-private xmlns="http://www.netbeans.org/ns/project-private/1">
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/1"/>
- <open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/1">
- <file>file:/home/smckown/workspace/picdimmy/main.c</file>
- </open-files>
</project-private>