Ir ao conteúdo
  • Cadastre-se

George Frederick

Membro Júnior
  • Posts

    4
  • Cadastrado em

  • Última visita

Reputação

1
  1. Sim, já esta linkado. quando você abrir o projeto no c18, verá que na lista de arquivo terá o .lkr sem o bootloader seria necessário um gravador de pic, e porta serial ( e eu não possuo nenhum dos dois, por isso optei por comprar este modulo). no começo fiquei com muitas duvidas e medo de perder o bootloader, mas é tranquilo. inclusive iniciei um projeto no ccs também, já com o bootloader.
  2. Geralmente configuro assim: TRISA = 0b11001111; ai sei o que é cada porta. O .lkr tem que está na mesma pasta, e se não me engano, no projeto deve-se add o linker. mas não sei se é obrigatório. Segue meu projeto que utilizo como padrão, para iniciar qualquer outro. padrão.X.zip
  3. Os exemplos estão dentro da pasta que voce fez a instalação o arquivo PROTOn. ex: C:\Program Files (x86)\PROTOn caso não consiga, segue os arquivos: C18.rar
  4. Bom dia. eu tenho um desse. Segui os exemplos que foram disponibilizados para donwload (http://www.smartradio.com.br/loja-pic/?id=42) Você precisa colocar as referencias do bootloader. faça os download disponíveis, e tem alguns exemplos. Tenho um projeto padrão para o mplab que separai tudo em arquivos separados, apenas fazendo a chamada. deve possuir isso antes do programa: /** B O O T L O A D E A R ****************************************************/ // para usar gravaзгo bootloader por usb hid sempre usar este trecho void YourHighPriorityISRCode(); void YourLowPriorityISRCode(); #define PROGRAMMABLE_WITH_USB_HID_BOOTLOADER #if defined(PROGRAMMABLE_WITH_USB_HID_BOOTLOADER) #define REMAPPED_RESET_VECTOR_ADDRESS 0x1000 #define REMAPPED_HIGH_INTERRUPT_VECTOR_ADDRESS 0x1008 #define REMAPPED_LOW_INTERRUPT_VECTOR_ADDRESS 0x1018 #if defined(PROGRAMMABLE_WITH_USB_HID_BOOTLOADER)||defined(PROGRAMMABLE_WITH_USB_MCHPUSB_BOOTLOADER) extern void _startup (void); // See c018i.c in your C18 compiler dir #pragma code REMAPPED_RESET_VECTOR = REMAPPED_RESET_VECTOR_ADDRESS void _reset (void) { _asm goto _startup _endasm } #endif #pragma code REMAPPED_HIGH_INTERRUPT_VECTOR = REMAPPED_HIGH_INTERRUPT_VECTOR_ADDRESS void Remapped_High_ISR (void) { _asm goto YourHighPriorityISRCode _endasm } #pragma code REMAPPED_LOW_INTERRUPT_VECTOR = REMAPPED_LOW_INTERRUPT_VECTOR_ADDRESS void Remapped_Low_ISR (void) { _asm goto YourLowPriorityISRCode _endasm } #if defined(PROGRAMMABLE_WITH_USB_HID_BOOTLOADER)||defined(PROGRAMMABLE_WITH_USB_MCHPUSB_BOOTLOADER) //Note: If this project is built while one of the bootloaders has //been defined, but then the output hex file is not programmed with //the bootloader, addresses 0x08 and 0x18 would end up programmed with 0xFFFF. //As a result, if an actual interrupt was enabled and occured, the PC would jump //to 0x08 (or 0x18) and would begin executing "0xFFFF" (unprogrammed space). This //executes as nop instructions, but the PC would eventually reach the REMAPPED_RESET_VECTOR_ADDRESS //(0x1000 or 0x800, depending upon bootloader), and would execute the "goto _startup". This //would effective reset the application. //To fix this situation, we should always deliberately place a //"goto REMAPPED_HIGH_INTERRUPT_VECTOR_ADDRESS" at address 0x08, and a //"goto REMAPPED_LOW_INTERRUPT_VECTOR_ADDRESS" at address 0x18. When the output //hex file of this project is programmed with the bootloader, these sections do not //get bootloaded (as they overlap the bootloader space). If the output hex file is not //programmed using the bootloader, then the below goto instructions do get programmed, //and the hex file still works like normal. The below section is only required to fix this //scenario. #pragma code HIGH_INTERRUPT_VECTOR = 0x08 void High_ISR (void) { _asm goto REMAPPED_HIGH_INTERRUPT_VECTOR_ADDRESS _endasm } #pragma code LOW_INTERRUPT_VECTOR = 0x18 void Low_ISR (void) { _asm goto REMAPPED_LOW_INTERRUPT_VECTOR_ADDRESS _endasm } #endif //end of "#if defined(PROGRAMMABLE_WITH_USB_HID_BOOTLOADER)||defined(PROGRAMMABLE_WITH_USB_LEGACY_CUSTOM_CLASS_BOOTLOADER)" #endif #pragma code //These are your actual interrupt handling routines. #pragma interrupt YourHighPriorityISRCode void YourHighPriorityISRCode() { //Check which interrupt flag caused the interrupt. //Service the interrupt //Clear the interrupt flag //Etc. #if defined(USB_INTERRUPT) USBDeviceTasks(); #endif } //This return will be a "retfie fast", since this is in a #pragma interrupt section #pragma interruptlow YourLowPriorityISRCode void YourLowPriorityISRCode() { //Check which interrupt flag caused the interrupt. //Service the interrupt //Clear the interrupt flag //Etc. } //This return will be a "retfie", since this is in a #pragma interruptlow section /** F I M * B O O T L O A D E A R ********************************************/] /** C O N F I G U R A Ç Õ E S B I T S ****************************************/ #pragma config PLLDIV = 5 // (20 MHz crystal on PICDEM FS USB board) #pragma config CPUDIV = OSC1_PLL2 #pragma config USBDIV = 2 // Clock source from 96MHz PLL/2 #pragma config FOSC = HSPLL_HS #pragma config FCMEN = OFF #pragma config IESO = OFF #pragma config PWRT = OFF #pragma config BOR = ON #pragma config BORV = 3 #pragma config VREGEN = ON //USB Voltage Regulator #pragma config WDT = OFF #pragma config WDTPS = 32768 #pragma config MCLRE = ON #pragma config LPT1OSC = OFF #pragma config PBADEN = OFF #pragma config STVREN = ON #pragma config LVP = OFF #pragma config XINST = OFF // Extended Instruction Set #pragma config CP0 = OFF #pragma config CP1 = OFF #pragma config CPB = OFF #pragma config WRT0 = OFF #pragma config WRT1 = OFF #pragma config WRTB = OFF // Boot Block Write Protection #pragma config WRTC = OFF #pragma config EBTR0 = OFF #pragma config EBTR1 = OFF #pragma config EBTRB = OFF vamos conversar posteriormente sobre ele. recentemente tentei realizar comunicação do display de lcd e não consegui. Cara, pode ter ficado meio confuso. É que estou no serviço, e só quis dar uma ajuda inicial. Mas se não conseguir, conversamos posteriormente. E se conseguir, conversamos posteriormente para outros testes.

Sobre o Clube do Hardware

No ar desde 1996, o Clube do Hardware é uma das maiores, mais antigas e mais respeitadas comunidades sobre tecnologia do Brasil. Leia mais

Direitos autorais

Não permitimos a cópia ou reprodução do conteúdo do nosso site, fórum, newsletters e redes sociais, mesmo citando-se a fonte. Leia mais

×
×
  • Criar novo...