+ Reply to Thread
Page 6 of 9
First ... 2 3 4 5 6 7 8 9 Last
Results 76 to 90 of 131

Thread: where do i learn bout PIC ?

  1. #76
    kupikupi Newbie
    Join Date
    Aug 2005
    Posts
    84

    Default

    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


  2. #77
    Super Moderator Jay.slovak Good Jay.slovak Good Jay.slovak Good
    Join Date
    Jan 2005
    Location
    Slovakia
    Posts
    1,740

    Default

    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.

  3. #78
    kupikupi Newbie
    Join Date
    Aug 2005
    Posts
    84

    Default

    Quote Originally Posted by Jay.slovak
    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.
    wats D'000 actually??

    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??

  4. #79
    Super Moderator Jay.slovak Good Jay.slovak Good Jay.slovak Good
    Join Date
    Jan 2005
    Location
    Slovakia
    Posts
    1,740

    Default

    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!

  5. #80
    kupikupi Newbie
    Join Date
    Aug 2005
    Posts
    84

    Default

    movlw D’25’
    movwf SPBRG ;initialize SPBRG
    movlw H’24’
    movwf TXSTA ;initialize TXSTA
    movlw H’90’
    movwf RCSTA ;initialize RCSTA
    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??
    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

  6. #81
    Super Moderator Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent
    Join Date
    Nov 2003
    Location
    Derbyshire, UK
    Posts
    29,791

    Default

    Quote Originally Posted by kupikupi
    movlw D’25’
    movwf SPBRG ;initialize SPBRG
    movlw H’24’
    movwf TXSTA ;initialize TXSTA
    movlw H’90’
    movwf RCSTA ;initialize RCSTA
    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??
    could anyone help me to modify it so that i can upload it directly to the PIC??
    im really 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?.
    PIC programmer software, and PIC Tutorials at:
    http://www.winpicprog.co.uk

  7. #82
    kupikupi Newbie
    Join Date
    Aug 2005
    Posts
    84

    Default

    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?
    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??

  8. #83
    Super Moderator Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent
    Join Date
    Nov 2003
    Location
    Derbyshire, UK
    Posts
    29,791

    Default

    Quote Originally Posted by kupikupi
    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?
    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??
    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.

    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

  9. #84
    kupikupi Newbie
    Join Date
    Aug 2005
    Posts
    84

    Default

    thanx nigel... but when do we need to use USART ?
    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...
    this was fromm jay ...
    u said i dont have to worry bout USART.. may i ask wat takes care of the transmission??

  10. #85
    kupikupi Newbie
    Join Date
    Aug 2005
    Posts
    84

    Default

    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 ?

  11. #86
    Super Moderator Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent
    Join Date
    Nov 2003
    Location
    Derbyshire, UK
    Posts
    29,791

    Default

    Quote Originally Posted by kupikupi
    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).

    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

  12. #87
    kupikupi Newbie
    Join Date
    Aug 2005
    Posts
    84

    Default

    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.... :?

  13. #88
    Super Moderator Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent
    Join Date
    Nov 2003
    Location
    Derbyshire, UK
    Posts
    29,791

    Default

    Quote Originally Posted by kupikupi
    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!.

    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

  14. #89
    kupikupi Newbie
    Join Date
    Aug 2005
    Posts
    84

    Default

    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?

  15. #90
    Super Moderator Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent
    Join Date
    Nov 2003
    Location
    Derbyshire, UK
    Posts
    29,791

    Default

    Quote Originally Posted by kupikupi
    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:

    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

+ Reply to Thread
Page 6 of 9
First ... 2 3 4 5 6 7 8 9 Last

Tags for this Thread