![]() #pragma config WRTB = OFF // Boot Table Write Protect #pragma config WRT0 = OFF // Table Write Protect #pragma config CPD = OFF // EEPROM Data Protect #pragma config CPB = OFF // Boot Sect Code Protect #pragma config DEBUG = OFF // Background Debugging #pragma config XINST = OFF // Ext CPU Instruction Set #pragma config LVP = OFF // High Voltage Programming #pragma config STVREN = ON // Stack Overflow Reset #pragma config CCP2MX = ON // CCP2 Mux RC1 #pragma config LPT1OSC = OFF // Low Power OSC #pragma config WDT = OFF // WatchDog Timer #pragma config VREGEN = ON // Int Voltage Regulator #pragma config PWRT = ON // PowerUp Timer #pragma config IESO = OFF // Int/Ext switchover mode #pragma config FCMEN = ON // Fail Safe Clock Monitor #pragma config FOSC = HSPLL_HS // HS osc PLL #pragma config USBDIV = 2 // USB_clk = PLL/2 #pragma config CPUDIV = OSC1_PLL2 // CPU_clk = PLL/2 It can be downloaded from here.This is a command line example to run pk2cmd and load the Pinguino bootloader: I use the Microchip pk2cmd software to run it. I am using a PICKit2 programmer clone from to burn stand alone programs and the Pinguino bootloader. To assemble the source code, I use GPASM which is part of the GPUTILS package. However, I did some experimentation and found solutions to make it all work.īefore I show the code, let’s first talk about the tools I am using (under Linux). I did not find much on what I specifically wanted, especially using interrupts with the Pinguino bootloader. Even the Pinguino WIKI shows 6 ways to blink an LED here, however all examples there are in ‘C’. You might also guess, and be correct, that the internet is full of tutorials and code on how to blink an LED. Also, I wanted both of them to work stand alone and with the Pinguino bootloader. I wanted to create example PIC18F4550 assembler programs to blink an LED at intervals with a delay routine and with an interrupt timer. As you might guess, I decided to try the standard “Hello World!” program (i.e. ![]() I used one of my DIY PIC18F4550 Pinguinos for experimentation. The ‘C’ language is usually efficient enough and easier to code for most projects I do. I hadn’t really used it for a number of years (since before 2009). I became re-interested in Microchip PIC assembler coding recently.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |