Jay ... the LED blinking program u wrote ....
'Code:ZDRZ0 equ D'000' ZDRZ1 equ D'001' ZDRZ2 equ D'002
wat does this mean ?? i cant find it in Nigel's tute nor the datasheet... is there anywhere i cant learn mainly bout assembly language
Jay ... the LED blinking program u wrote ....
'Code:ZDRZ0 equ D'000' ZDRZ1 equ D'001' ZDRZ2 equ D'002
wat does this mean ?? i cant find it in Nigel's tute nor the datasheet... is there anywhere i cant learn mainly bout assembly language
That's an example of "equ" Assmebler directive, it tells the Compiler, to substitute ZDRZ0 with D'000' everytime it finds it in source code (when you hit the Build button).
It's more practical to write MOVF ZDRZ0,w than MOVF D'0',w so it is more Human like :lol:
BTW: I am refering to Data memory - RAM registers.
"I share, thus I am"
Jay.slovak
Read this!
ICD2 Clone
Best PIC/DsPIC Bootloader
Read my Inchworm ICD2 review!
wats D'000 actually??Originally Posted by Jay.slovak
another thing .. in Nigel's tute .. there was something called CMCON... but that for the 16F series... if i wanted to modify it for 18F series... wat do i do?
when u changed it .. how did u know wat 16F doesnt have that 18F has??
D'000' is the same as 0 (just looks better), and it's the address of first memory place in RAM (for 18F), treat it as a Variable to store data.
As for CMCON, one word Datasheet!
Everything you need is in there, just read it carefully!
"I share, thus I am"
Jay.slovak
Read this!
ICD2 Clone
Best PIC/DsPIC Bootloader
Read my Inchworm ICD2 review!
i want to upload the USART codes into my PIC so that the PIC can communicate with the PC ... do i use the codes above??movlw D’25’
movwf SPBRG ;initialize SPBRG
movlw H’24’
movwf TXSTA ;initialize TXSTA
movlw H’90’
movwf RCSTA ;initialize RCSTA
could anyone help me to modify it so that i can upload it directly to the PIC??
im really terrible at assembly and I'm learning it now.. but i need to use it tomorrow. please help me .. thanx
The codes above simply initialise the USART, it doesn't actually 'do' anything - you also don't give any clue as to what you want to do?. 'Communicate with the PC' is so vague as to be meaningless?.Originally Posted by kupikupi
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
sorry bout that... well .. for my project, there are 2 ways of uploading programs into the PIC one of them will be using a programmer called " pic start plus" i can only use it in the Uni lab, so , there is another way to upload program which is thru a serial port RS 232 using MAX 232 converter, but i was told that i cant upload a program directly without USART .. but how do i use USART??The codes above simply initialise the USART, it doesn't actually 'do' anything - you also don't give any clue as to what you want to do?. 'Communicate with the PC' is so vague as to be meaningless?
You don't need to worry about the USART, what you need is a bootloader program, you use the PICStart Plus to program the bootloader into the PIC. You can then use a PC program (which will be provided with the bootloader, or even something as simple as Hyperterminal) to transfer programs via RS232 to the PIC.Originally Posted by kupikupi
There are various bootloader programs at http://www.microchipc.com/, I've never used the 18F ones, but the 16F ones are excellent!.
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
thanx nigel... but when do we need to use USART ?
this was fromm jay ...USART is a hardware peripheral, which will take care of the transmission itself, so that your code can do somethnig else while you are sending/receiving.
Bootloader is a software routine that takes Bytes from USART and place them into Program memory...
u said i dont have to worry bout USART.. may i ask wat takes care of the transmission??
another question...
lets say i have a LED blinking program in my PIC, i want to upload a motor driving program ...
when i upload it ... do i have to do anything so that i wont overwrite the previous program or i just upload it and the bootloader will arrange it for me ?
The bootloader takes care of the USART, all you need to do is provide suitable hardware (as in a MAX232 connected to the USART pins).Originally Posted by kupikupi
As I said, I've not used 18F bootloaders, but in the 16F the bootloader code is written at the very top of memory. Normal programs run in the lower parts of memory, so the bootloader code is out of the way. When you upload a new program, it overwrites the previous one, but the bootloader itself isn't touched (or shouldn't be!).
There's no reason not to overwrite the previous program, not doing so wouldn't achieve very much?.
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
so do u mean that the PIC can only take one program at once?
meaning that if i want the PIC to perform multi tasks , i have to combine all the programs into 1 ?? i cant separate the programs?? i'm really new with PIC, i dont know how it works.... :?
Essentially yes!.Originally Posted by kupikupi
There's nothing to stop you writing a multi-tasking operating system if you so wished?, bear in mind even a PC doesn't multi-task at all well!, the Intel processors are very badly suited for it!.
But the small amounts of program memory available would waste too much of the OS, and not leave much available for programs. Bear in mind, this is a micro-controller, NOT a full blown computer with multi-megabytes of memory and gigabytes of hard disk.
However, it's hard to think of anything that would require such an OS?, the PIC's huge advantage is it's small size and speed, multi-tasking would cripple the speed, just as it does on (almost!) everything else.
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
i'm a little confused about the Tiny bootloader that Jay was talking about, is it a .hex file to program into the PIC or is it software like Mplab ?? from the previous post i understood that Tiny bootloader has the same function as Mplab(i used mplab to upload program into the PIC thru picstart plus,now i want to upload programs from home using serial port) so could i just use mplab instead of the the tiny bootloader ? is it the same ?? and i still need to upload a bootload .hex file into the pic thru picstart plus b4 i can do so right??
i went thru the tiny bootloader site and i cant find any bootloader .hex file. could anyine help me out here??how do u rite a bootloader hex file?
The URL I posted earlier has source code for bootloaders, but to be honest, if you've got to ask you probably aren't capable of it? :cry:Originally Posted by kupikupi
But there's no need, they are many bootloaders you can download, any site with them on should explain what you need on the PC - even if it's just a simple terminal program.
I wouldn't expect MPLAB to perform this task?, it's basically an editor and simulator, with links to the MicroChip programmers (like the PICStart Plus) and the assembler MPASM.
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk