Some would have an example of as to generate 250Khz alternating.
Using PIC16F873A and Crystal 20Mhz And WatDog is Enable.
Only test.
Example:
Code: Select all
Loop:
High PORTB.7
Low PORTB.6
Low PORTB.7
PORTB.6
Goto Loop
Code: Select all
Loop:
High PORTB.7
Low PORTB.6
Low PORTB.7
PORTB.6
Goto Loop
Code: Select all
while(1)
{
bit_set (portb, 7);
bit_clear(portb, 6);
bit_clear(portb, 7);
bit_set (portb, 6);
clear_wdt();
}
Code: Select all
Device=16F873A
Declare XTAL=20
@CONFIG_REQ
@__CONFIG PWRTE_ON & WDT_ON & HS_OSC & LVP_OFF
TRISB = %00000000
freq:
High PORTB.7
Low PORTB.6
Low PORTB.7
High PORTB.6
GoTo freq