Ich habe den Bootloader wie folgt erstellt:
radix DEC
LIST P=18F2585 ; change also: Configure->SelectDevice from Mplab
xtal EQU 20000000 ; you may want to change: _XT_OSC_1H _HS_OSC_1H _HSPLL_OSC_1H
baud EQU 115200 ; the desired baud rate
delaytime EQU 2000000 ; for 40MHz: 1000000 gets about 1sec, for 20MHZ: 2000000 gets about 1sec
; The above 4 lines can be changed and buid a bootloader for the desired frequency (and PIC type)
;********************************************************************
; Tiny Bootloader 18F series Size=100words
; claudiu.chiculita@ugal.ro
; http://www.etc.ugal.ro/cchiculita/software/picbootloader.htm
;********************************************************************
#include "../icdpictypes.inc" ;takes care of: #include "p18fxxx.inc", max_flash, IdTypePIC
#include "../spbrgselect.inc" ; RoundResult and baud_rate
#define first_address max_flash-200 ;100 words
;can we dump these ? winpic etc have the function of configuring all
__CONFIG _CONFIG1H, _OSC_HS_1H & _FCMEN_OFF_1H & _IESO_OFF_1H
; __CONFIG _CONFIG2L, _PWRT_OFF_2L & _BOREN_OFF_2L
; __CONFIG _CONFIG2H, _WDT_OFF_2H & _WDTPS_1_2H
; __CONFIG _CONFIG3H, _MCLRE_ON_3H & _PBADEN_OFF_3H ;& _CCP2MX_PORTBE_3H not in 4680
; __CONFIG _CONFIG4L, _DEBUG_OFF_4L & _LVP_OFF_4L & _STVREN_OFF_4L & _XINST_OFF_4L
; __CONFIG _CONFIG5L, _CP0_OFF_5L & _CP1_OFF_5L & _CP2_OFF_5L
; __CONFIG _CONFIG5H, _CPB_OFF_5H
; __CONFIG _CONFIG6L, _WRT0_OFF_6L & _WRT1_OFF_6L & _WRT2_OFF_6L
; __CONFIG _CONFIG6H, _WRTB_OFF_6H & _WRTC_OFF_6H
; __CONFIG _CONFIG7L, _EBTR0_OFF_7L & _EBTR1_OFF_7L & _EBTR2_OFF_7L
; __CONFIG _CONFIG7H, _EBTRB_OFF_7H & _DEVID1 & _IDLOC0
Wenn ich nun ein Programm per TINY flashe funktioniert zwar das Flashen, aber die timings (delay_ms(xy)) stimmen nicht, und wenn ich variablen über die RS232 Ausgebe steht da nur müll drin.
Brenne ich das Testprogram direkt, läuft es einwandfrei

Das Testprogram:
int32 i;
int x;
int32 u;
void main()
{
setup_adc_ports(NO_ANALOGS|VSS_VDD);
setup_adc(ADC_OFF|ADC_TAD_MUL_0);
setup_spi(FALSE);
setup_wdt(WDT_OFF);
setup_timer_0(RTCC_INTERNAL);
setup_timer_1(T1_DISABLED);
setup_timer_2(T2_DISABLED,0,1);
setup_vref(FALSE);
setup_oscillator(False);
// TODO: USER CODE!!
i=0;
while(1)
{
i++;
U=4;
output_high(PIN_C4);
delay_ms(200);
output_high(PIN_C5);
delay_ms(300);
output_low(PIN_C5);
output_low(PIN_C4);
delay_ms(100);
printf("I=%lu Xc=%c Xd%d Ud=%ld\r\n",i,x,x,u);
}
}
Danke!!
Martin