Ehliseyf
Joined: 07 Sep 2010 Posts: 2 Location: Antalya
|
pic 18F4550 bootloader problem |
Posted: Mon Sep 13, 2010 6:43 am |
|
|
I have a running bootloader .hex file. And I have a running embedded code which was written in pic basic pro. But I don't know how to analyze and write in pic basic. I am also trying to write my own code which will be CCS C code. My code is down
This code does not run.
Note: To download my .hex code I am using Microchip USB HID bootloader ver2.2
My schema
http://320volt.com/wp-content/uploads/2010/07/pic18f4550-usb-isis-devre-semasi.png
but lcd connection change.
Code: |
#include <18F4550.h>
#fuses HSPLL,NOWDT,NOPROTECT,NOLVP,NODEBUG,USBDIV,PLL5,CPUDIV1,VREGEN
#use delay(clock=48000000)
#include "yeni_lcd.c"
#use fast_io(b)
#define use_portb_lcd True
#include <usb_bootloader.h>
#define _bootloader
/*
// START OF bootloader definition
#define LOADER_END 0x7FF
#define LOADER_SIZE 0x6FF
#build(reset=LOADER_END+1, interrupt=LOADER_END+9)
#org 0, LOADER_END {} // nothing will replace the bootloader memory space
// END OF bootloader definition
#org 0x1000,0x7ffe {} //bootloader()
*/
void main()
{
setup_adc_ports(NO_ANALOGS|VSS_VDD);
setup_adc(ADC_OFF);
setup_psp(PSP_DISABLED);
setup_spi(FALSE);
setup_timer_0(RTCC_INTERNAL);
setup_timer_1(T1_DISABLED);
setup_ccp1(ccp_off);
setup_timer_2(T2_DISABLED,0,1);
setup_timer_3(T3_DISABLED|T3_DIV_BY_1);
setup_comparator(NC_NC_NC_NC);
enable_interrupts(GLOBAL);
setup_vref(VREF_LOW|-2);
setup_oscillator(FALSE);
set_tris_b(0x00); //PORTB ÇIKIS
lcd_init();
for(;;)
{
printf(lcd_putc,"\f Kazanir");
delay_ms(1000);
}
}
|
_________________ AR-Ge |
|