MPASM is the assembler. MPLAB is the IDE that it comes with.
MPASM is the assembler. MPLAB is the IDE that it comes with.
Dave
Always wear safety glasses while programming.
Before we all conversed I purchased two books from amazon.com.
Sandhu's 'Running Small Motors with PIC microcontrollers' has all its code in PIC BASIC PRO. 2000+ lines according to the cover.
Parchizadeh and Vuksanovic's 'PIC Projects - A Practical Approach' has all its code in both assembly and C.
Many (many!) years ago I coded in assembly language a water cooled, vacuum tube constructed architecture eerily similar to the 16F877. We developed shared symbol tables and a library of shared routines. Do these exist in the WEB based world of Microchip PIC?
HI-TECH offers a freeware C - LITE compiler. The price is right, but this forum talks PIC BASIC. Decisions decisions...
Ken
Here is the place for ASM and C.
http://www.piclist.com/techref/piclist/index.htm
Start with the "Beginners Checklist" link.
Your project would be fun to have around here but cost is cost.
In ASM for Micros symols are not used.
Here is an example to blink one LED with PBP
Here is an example to blink one LED in ASM.Code:DEFINE OSC 20 @ __config _HS_OSC & _WDT_ON & _LVP_OFF & _CP_OFF START: HIGH PORTD.1 PAUSE 250 LOW PORTD.1 PAUSE 250 GOTO START
Code:; processor 16f876a #include <p16f876a.inc> ERRORLEVEL -224 ; Configuration bits __CONFIG _HS_OSC & _WDT_OFF & _PWRTE_ON & _BODEN_OFF & _LVP_OFF & _CPD_OFF & _WRT_OFF & _DEBUG_OFF & _CP_OFF CBLOCK 0x20 ; RAM starts at address 20h d1 d2 ENDC org 0x0000 ; start address = 0000h movlw B'00000000' tris PORTA movlw B'00000000' tris PORTB movlw B'00000000' tris PORTC movlw B'00000111' movwf CMCON movwf ADCON1 clrf PORTA clrf PORTB clrf PORTC movlw B'00000111' option loop: bsf PORTC,3 call Delay bcf PORTC,3 call Delay goto loop ; Delay = 0.1 seconds ; Clock frequency = 4 MHz ; Actual delay = 0.1 seconds = 100000 cycles ; Error = 0 % Delay ;99993 cycles movlw 0x1E movwf d1 movlw 0x4F movwf d2 Delay_0 decfsz d1, f goto $+2 decfsz d2, f goto Delay_0 ;3 cycles goto $+1 nop ;4 cycles (including call) return end
Dave
Always wear safety glasses while programming.
I hate .pdf reference manuals. I will stay with the group and purchase PIC BASIC (according to the picture it comes with both a CD and a real 20th Century paper manual). PIC BASIC LITE does not appear in the Microchip SEARCH engine. Oh, well. What's another $250? (I just paid $374 for the left tail light of my car. It comes as one big assembly. All I did was break the red plastic lens!)
I was intimidated by the 270 page and 290 page .pdf files which purported to tell me all I need to know to write in MPASM.
I have coded in assembly, in Pascal, in C and C++ (even fortran way back when). Never in Basic. I hope you guys a patient.
Ken
Glad to see you are sticking around.
Melanie is the only one to worry about.I have coded in assembly, in Pascal, in C and C++ (even fortran way back when). Never in Basic. I hope you guys a patient.
I hear she has a whip![]()
Dave
Always wear safety glasses while programming.
The demo PIC Assembly programs are straight forward. I understood them. They work.
I was happy to discover that the HI-TECH PICC lite integrates into MPLAB IDE easily. It offers a demo program that is much more complicated than the assembly shots. It worked here in sunny scenic Fitchburg Mass.
The MPLAB IDE contains another free C compiler. We'll see what it offers.
Ken
I ordered five DPDT relay switches early last week from Newark. They have not arrived yet. I have not prototyped a digital/analog circuit is over thirty years. We used wire wrap in the day. Yesterday I bought from Radio Shack solder, a low power iron, some small tools, and three different kinds of proto boards. It is not obvious how we physically attach capacitors, resistors, transistors, to these boards. I gather the inline chips get plugged into sockets that have pins which fit into these proto boards. Their back sides are designed for some kind of wire attachment. Wire wrap?
Can you guys point me to some revealing photographs?
Ken
Bookmarks