Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

where do i learn bout PIC ?

Status
Not open for further replies.
kupikupi said:
--- when does the bootloader comes into the picture?? is it when i want the PIC to communicate with the PC??

Bootloader is just the middle man, like a postman delivering a letter from one location to another, except that he lives in your garden/or one room of your house when he has nothing to do.

It gets the program HEX file from user's computer via serial communication and program it into the PIC remaining program memory(the bootloader uses part of the PIC program memory).

Bootloader requires a specific software running on the PC or MAC to work. This software running on the computer knows how to "talk" to the bootloader inside the PIC.

When you have sent your HEX file, and the bootloader written your codes to the remaining program memory, the bootloader's work is done and it just let your program takes over.

If your PIC program has codes to use the USART, then you can communicate with the PC using serial port. Don't expect the bootloader to offer you any "additional power" that your code does not have.
 
eblc1388 said:
kupikupi said:
--- when does the bootloader comes into the picture?? is it when i want the PIC to communicate with the PC??

Bootloader is just the middle man, like a postman delivering a letter from one location to another, except that he lives in your garden/or one room of your house when he has nothing to do.

It gets the program HEX file from user's computer via serial communication and program it into the PIC remaining program memory(the bootloader uses part of the PIC program memory).

Bootloader requires a specific software running on the PC or MAC to work. This software running on the computer knows how to "talk" to the bootloader inside the PIC.

When you have sent your HEX file, and the bootloader written your codes to the remaining program memory, the bootloader's work is done and it just let your program takes over.

If your PIC program has codes to use the USART, then you can communicate with the PC using serial port. Don't expect the bootloader to offer you any "additional power" that your code does not have.

wow!! this is super clear ... thanx
 
kupikupi said:
eblc1388 said:
Yes, RS232 works, but that comes after the PIC been programmed with the necessary code to make sense of the communication.

But at first the PIC is totally blank, don't understand anything about RS232.


hi guys... i'm back again .. want to thank all of u for helping me out in my project...all of u have been a great help to me .. i've almost completed the 1st part of the project.. which was to get the LED blinking. now comes the part where i have to interface the PIC with the PC..


So i found out that i did not need bootloader to blink my LED:
--- when does the bootloader comes into the picture?? is it when i want the PIC to communicate with the PC??

a way to upload program into the PIC was thru a programmer called " pic start plus" which i could only use in the lab :
--- now i want to upload programs at home where i don have the pic start plus
--- so do i use a serial port RS232 ... with the MAX 232 level converter to upload program into the PIC..

my PIC has only the LED blinking program in it .... from the quote above, it seems that i need to program something into it so that the PIC can communicate with the PC thru the MAX 232 level converter.. wat will it be?? and do i include the bootloader too ??

in PIC start plus.. i used MPLAB as the software to upload program into the PIC
--- wat do i use if i use serial port?? i've heard of "hyper terminal" .. but i dont know the use of it ...

hope u guys can help me out here... thanx a lot

btw Jay .. the LED blinking program u wrote for me worked very well... thanx very much ....


sorry i have to repost this in case someone missed it ...
btw .. my bootloader question has been answered by eblc1388 .. thanx
 
kupikupi said:
is it neccessary to have the bootloader in the PIC??
No, bootloader is handy when you don't have an access to real programmer or you want to upgrade your SW "in the field" (if you are a manufacturer and allow customers to upgrade their products with just connecting them to PC).
 
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...
 
Jay.slovak said:
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...

so i need a code so that the USART will work rite??
would it be this??

movlw D’25’
movwf SPBRG ;initialize SPBRG
movlw H’24’
movwf TXSTA ;initialize TXSTA
movlw H’90’
movwf RCSTA ;initialize RCSTA

i got it from somewhere and i dontknwo wat it does
 
Datasheet again:
 

Attachments

  • receive.gif
    receive.gif
    21 KB · Views: 511
so .. do i have to upload this program to the PIC thru a programmer(pic start plus) b4 i can use the serial port??
 
kupikupi said:
so .. do i have to upload this program to the PIC thru a programmer(pic start plus) b4 i can use the serial port??
Yes exactly, BUT you don't have to write your own bootloader, there are a plenty of pre-made ones! Just go to Tiny Bootloader site and download it there (I contributed with code for 18F4320 ).
 
kupikupi said:
in PIC start plus.. i used MPLAB as the software to upload program into the PIC
--- wat do i use if i use serial port?? i've heard of "hyper terminal" .. but i dont know the use of it ...

could anyone give me some help on this??
 
kupikupi said:
kupikupi said:
in PIC start plus.. i used MPLAB as the software to upload program into the PIC
--- wat do i use if i use serial port?? i've heard of "hyper terminal" .. but i dont know the use of it ...

could anyone give me some help on this??
I have told you that! Tiny PIC Bootloader (it's a PC software and PICs bootloader), programming is done through Serial port.
 
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.
 
Jay.slovak said:
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??
 
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!
 
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
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top