Movwf ANSEL Set analog i/o for digital i/o (Never leave this to chance) Movwf ADCON1 Disble ADC module (Never leave this to chance) Movlw b'00000000' Set all port pins to output / Disable ADC / Set for digital i/o MAIN_PROG CODE let linker place main program RES_VECT CODE 0x0000 processor reset to vector address zero _CONFIG _CONFIG1, _FOSC_INTOSCIO & _WDTE_OFF & _PWRTE_OFF & _MCLRE_OFF & _BOREN_ON & _LVP_OFF & _CPD_OFF & _WRT_OFF & _CCPMX_RB0 & _CP_OFF To slow the program down enough to see the LED flickering, time delay code will be needed. The program flashes the LED (too fast to see the flicker) and drives the sounder which whines at 850 Hz. This was written using MPLAB-X and the built-in wizards for setting the configuration registers. PIC16F88 Assembly Code "Hello World!" Program There is a 20 mA current limit (a couple of LEDs). Toolbar Button Green Down Arrow > Make and Program Device Main Projectįile ↠ Project Properties ↠ Set it up like this. ![]() ![]() Run > Build Main Project ( or use the blue hammer icon ) ![]() Right click Projects, Source Files > New > newpic_8b_general - Rename the file to whatever you like > FinishĪdd to the template code or replace it with pasted examples. Name your project and give it a folder to save the files > Finish Your device is a PIC16F88 or choose something different if you need to. Microchip Embedded, Standalone Project > Next A Level PIC16F88 01 PICkit3 > 02 MPLAB X> New Project
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |