ja, ich habe alles unter dem ccs c compiler mit dem project wizard angegeben.
hier mal die header datei:
Code:
#include <18F4520.h>
#device adc=8
#use delay(clock=4000000)
#fuses NOWDT,WDT128,HS, NOPROTECT, BROWNOUT, BORV25, PUT, NOCPD, STVREN, NODEBUG, LVP, NOWRT, NOWRTD, IESO, FCMEN, NOPBADEN, NOWRTC, NOWRTB, NOEBTR, NOEBTRB, NOCPB, LPT1OSC, MCLR, NOXINST
und dann natürlich auch die c datei:
Code:
#include "dummeszeug.h"
void main()
{
setup_adc_ports(NO_ANALOGS|VSS_VDD);
setup_adc(ADC_OFF);
setup_psp(PSP_DISABLED);
setup_spi(FALSE);
setup_wdt(WDT_OFF);
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_16);
setup_timer_1(T1_DISABLED);
setup_timer_2(T2_DISABLED,0,1);
setup_timer_3(T3_DISABLED|T3_DIV_BY_1);
setup_comparator(NC_NC_NC_NC);
setup_vref(FALSE);
set_tris_a( 0b10000000);
set_tris_b( 0b00000111);
set_tris_c( 0b10011000);
set_tris_d( 0b00000000);
set_tris_e( 0b00000000);
while( 1)
{
output_high( PIN_C6);
delay_ms( 1000);
output_low( PIN_C6);
delay_ms( 1000);
}
}
und: an dem osc1 liegen 0v an und am dem osc2 liegen 3,3v an.
Lesezeichen