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.
[/quote]Yes!
has to be started prior your code - after Reset).[/quote]

sorry i dont get this part... does it not automatically start ?? how do i start it??
after which reset??
 
Bootloader is autostarting by default, but this takes ~1second, so sometimes this is a problem. Every Reset is triggering bootloader, because:
Code:
ORG 0
Goto Bootloader
is in the PIC.
 
Jay.slovak said:
Bootloader is autostarting by default, but this takes ~1second, so sometimes this is a problem. Every Reset is triggering bootloader, because:
Code:
ORG 0
Goto Bootloader
is in the PIC.

so u mean i have to reset before uploading the codes??
 
Code:
;*****************************************************************
	list	p=18F452	R=DEC
	#include	<P18F452.INC>

	ERRORLEVEL 2

Jay , this was the from the program u sent , what does error level 2 means??
and a few words i can't understand

Podprogramy Zdrzania @20Mhz
Hlavny Program

i actually know very little bout assembly language... which part does

(;********* ) ignore?
and can i get the meaing of the commands and syntax used??
thanx jay for taking the trouble to reply all my posts..
 
ERRORLEVEL 2 supreses Warning messages (such as "Ensure the banking bits are correct"), they just fill-up Build log.
Code:
Because I am Slovak: 
Podprogramy Zdrzania @20Mhz (Delay subprograms @ 20Mhz)
Hlavny Program (Main Program)

(;********* ) ignore?
Yes, Ignore that. It's for formating purposes only.

All "Commands" - Instructions can be found in the Datasheet!
 
Jay .. im going thru the program u wrote for me ...
does #include <P18F452.INC> means u include all configuration flags??
because i can't find that part ..... thanx
 
No, I set the Config Bits directly in MPLAB, it's faster to do than in code and I wanted to make it fast for you. In other cases I always put them in the code.

That include file is necessary for writting in human friendly language:
Code:
instead:
MOVF 7h,1
you can write:
MOVF PORTB,f
 
Jay.slovak said:
No, I set the Config Bits directly in MPLAB, it's faster to do than in code and I wanted to make it fast for you. In other cases I always put them in the code.
so does it mean when i upload this prog ... i have to set it in the mplab i use?? if so .. how do i do it?? .... or do i just upload the program u sent me straight into the PIC thru MPLAB?? and are all the protection flags off so that i can reuse the PIC??
 
The HEX file has config bits set correctly, if you want to use and compile ASM file, you have to set them in MPLAB.
Here is a screenshot, red framed things are esential.
 

Attachments

  • how_to.png
    how_to.png
    56.1 KB · Views: 802
For pic16F devices, setting the configuration bits in MPLAB only tells the debugger (MPLAB SIM for example) how to run. You still have to add the configuration bits to your code if you want them to be incorporated into the HEX file...

Is it diffirent for Pic18F devices Jay ? Could be, i didnt try yet...
 
Oh I just verified that MPLAB doesn't save Config Bits into HEX file (strange, it works with ICD2), Neither with 18F.
 
Start a new project, and then right click on that panel and select Add Files, INC and LKR files are in "C:\Program Files\Microchip\MPASM Suite"
 
Exo said:
For pic16F devices, setting the configuration bits in MPLAB only tells the debugger (MPLAB SIM for example) how to run. You still have to add the configuration bits to your code if you want them to be incorporated into the HEX file...

Is it diffirent for Pic18F devices Jay ? Could be, i didnt try yet...
OK I found a workaround, go to File/Export and save HEX. This way it WILL have Cinfig bits inside HEX.

Fixed HEX file:
 

Attachments

  • 18f452.hex_113.txt
    90.9 KB · Views: 154
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 ....
 
Status
Not open for further replies.

Latest threads

Back
Top