Hi there, hope you guys dont mind me starting this post and throw in general and simple questions regarding PIC from time to time. Newbie here...need help. Thanks in advance.
Would like to ask, if you guys mind explaining regarding the following instruction in PIC:
Cblock is directive for block of variable definition
Cblock 0x20 means that first variable (MULTA) is at address 0x20,
secound(MULTB) at 0x21.. and so on...
It is the same as :
MULTA equ 0x20
MULTB equ 0x21
...
MULTA and MULTB are variables, each one is a 8 bits block.
'CBLOCK' Means you start a variable block ( area ), where MULTA and MULTB are stocked
In that example, MULTA will be placed at 0x20 adress, and MULTB at 0x21, and so on...
Every you start a CBLOCK block, you must end with 'ENDC'
Thanks for that detaili explanation. Another question: Would like to ask regarding the multiplication process. For instance, if I were to multiply a 8-bit binary number with 4. But, I'm only concern the LSB of the 8-bit binary value, can I sort multiply a "4-bit binary" with the value 4? For intance:
8-bit binary value = B'00001010' ;where 1010 is my main concern
multiply by four.
Can I consider this as multiply 4-bit binary value by the value four? Meaning, can I write the following code?
CLRC
RLF MULTB,F
RLF MULTB,F
By just shifting twice, can I say that I've multiply the 4-bit binary value by four? Will writing the code in this manner, where I neglect the other four MSB of the 8-bit binary number cause any problems? For your information, the other four MSB of the 8-bit binary number always remains '0'. Advice needed. Thanks in advance...
Hi there, would like to ask regarding the implementation of the LCD. From scratch, if I were to use a LCD to display certain parameters, do you guys mind guiding me, what are the considerations that I need to first consider? As in the drivers and etc...The only thing that I have in mind is to use a 16x2 line LCD. Help really needed.
How should I write the EQU for the RESULTLOW2 and RESULTHIGH2?
Meaning,
RESULTHIGH2 EQU ?
RESULTLOW2 EQU ?
Does it mean that these registers can be any from the General Purpose Register? If I'm using 16F876, means I can use from 20H to 7FH? Is this right? Thanks in advance...
In the simulation, using MPLAB, I have error stating that symbol ABC not previously defined, mind to give some advice on this matter? Please? I'm confused as only some of my CALL ***, the errors are shown but some are not.
Need help again, hope you guys dont mind helping. Thanks in advance. In the PIC programming, using assembly language, how do I generate a specific delay? As in, how do I know specifically I'm generating, for instance a 5 seconds delay? Do you guys mind teaching how do I determine how long is a cycle? Am I right to say that it depends on the crystal that I'm using, where if I'm using a 20Mhz crystal, it means that 1 cycle is 1/20Mhz?
Need help again, hope you guys dont mind helping. Thanks in advance. In the PIC programming, using assembly language, how do I generate a specific delay? As in, how do I know specifically I'm generating, for instance a 5 seconds delay? Do you guys mind teaching how do I determine how long is a cycle? Am I right to say that it depends on the crystal that I'm using, where if I'm using a 20Mhz crystal, it means that 1 cycle is 1/20Mhz?
The PIC runs at 4 ticks per cycle, so it's running at 5 million instructions/sec,
not 20 million. Here is a web page that I think you'll find most interesting: