![]() |
| ||
| Please help with the assembly code Hey, I am willing to use the following code in one phase of my project. The problem is that i dont understand this assembly language, In school I took it in different form... Mov ax, bx out 11, AL bla bla... here the registers is different and everything is different.... All I need is to know what are the input and output pins... say port A0-A3 INPUT PORT B0-B7 OUTPUT bc i really dont know the input and output ports in the code... the code is to be used on pic16f628 here is the microcontroller datasheet in case u need it http://ww1.microchip.com/downloads/e...Doc/40300C.pdf and here is the code: ;Tutorial 7_5 thnx a lot in advance |
| ||
| Re: Please help with the assembly code Hi, I suggest you to download the main PIC 16F84A manual. (or the one related to your PIC) There you will see a list of registers and opcodes. Actually for PIC registers is like memory (there are a lot of theme) and the only register is working register which is W. For example you can't move a value to a register directly you have to load it to working register first : movlw .01010101; movwf TRISA The TRIS_ registers adjust wether the pins of the related port (TRISA -> PORTA) are to be used for input or output. (not both are possible for all port/pins) There also are two memory (register) banks you have to set BSF STATUS, RP0 ; bit set status register bit RP0 to select bank 1 clrf TRISA ;make PORTA all pins outputs BCF STATUS, RP0 ;select back bank 0 PORTA,PORTB,... are on bank 0 and TRISA, TRISB, ... are on bank 1 (check register map on the reference) clrf PORTA; clear all bits/pins of PORTA Those are the basics, post if you need any more knowledge. Loren Soth |
| All times are GMT -4. The time now is 12:02 am. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC