kisa72
Newbie level 4
- Joined
- Jun 26, 2013
- Messages
- 6
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1
- Activity points
- 59
//(c)Shane Tolmie, http://www.microchipc.com/, distribute freely for non commercial use on the condition that you include this web link somewhere in your document.
#include <pic.h> //designed for PIC16F877
#include <htc.h>
#define _XTAL_FREQ 20000000L // Used in __delay_ms() functions
#define OUTPUT 0
#define INPUT 1
main()
{
while(1)
{
TRISB1=OUTPUT; //change port RB1 direction to output
RB1=1; //produce 5V on RB1, pin 2 of micro
__delay_ms(500); // delay 500ms
RB1=0; //produce 0V on RB1, pin 2 of micro
__delay_ms(500); // delay 500ms
}
}
//(c)Shane Tolmie, http://www.microchipc.com/, distribute freely for non commercial use on the condition that you include this web link somewhere in your document.
#include <pic.h> //designed for PIC16F877
#include <htc.h>
#define _XTAL_FREQ 20000000L // Used in __delay_ms() functions
#define OUTPUT 0
#define INPUT 1
main()
{
TRISB1=OUTPUT; //change port RB1 direction to output
while(1)
{
RB1=1; //produce 5V on RB1, pin 2 of micro
__delay_ms(500); // delay 500ms
RB1=0; //produce 0V on RB1, pin 2 of micro
__delay_ms(500); // delay 500ms
}
}
//(c)Shane Tolmie, http://www.microchipc.com/, distribute freely for non commercial use on the condition that you include this web link somewhere in your document.
#include <pic.h> //designed for PIC16F877
#include <htc.h>
__CONFIG ( FOSC_HS & WDTE_OFF & PWRTE_OFF & CP_OFF & BOREN_OFF & LVP_OFF & CPD_OFF & WRT_OFF & DEBUG_OFF );
#define _XTAL_FREQ 20000000L // Used in __delay_ms() functions
#define OUTPUT 0
#define INPUT 1
main()
{
TRISB1=OUTPUT; // change port RB1 direction to output
TRISB2=OUTPUT; // change port RB2 direction to output
while(1)
{
RB1=1; // produce 5V on RB1, pin 34 of micro
RB2=0; // produce [U]0[/U]V on RB2, pin 35 of micro
__delay_ms(500); // delay 500ms
RB1=0; // produce 0V on RB1, pin 34 of micro
RB2=1; // produce [U]5[/U]V on RB2, pin 35 of micro
__delay_ms(500); // delay 500ms
}
}
Address | Value | Category | Setting |
2007 | FFB2 | Oscillator | HS |
Watchdog Timer | Off | ||
Power Up Timer | On | ||
Brown Out Detect | Off | ||
Low Voltage Program | Enabled | ||
Data EE Read Protect | Off | ||
Flash Program Write | Write Protection Off | ||
Code Protect | Off |
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?