go away spammer

Author Topic: regarding MPLAB and PIC...  (Read 7814 times)

0 Members and 1 Guest are viewing this topic.

Offline sambhavTopic starter

  • Jr. Member
  • **
  • Posts: 20
  • Helpful? 0
regarding MPLAB and PIC...
« on: March 07, 2007, 11:11:45 AM »
hiii..
i m writing a program for my project in assembly using MPLAB for pic16f877 ...
i referred to some tutorials on the net and learnt about it...
howevr i still didnt understand wat the configuration word stands for...
its sumthin dat begins wid
__CONFIG
and has many parameters in it...
Can anyone plz explain me...in detail...also wat is PWRTE_ON and PWRTE_OFF...???

i have brought the PIC16f877 chip... is der any way by testing if the chip is working or nt..???

plz help me..plz...

thanx..

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: regarding MPLAB and PIC...
« Reply #1 on: March 07, 2007, 02:33:36 PM »
i dont know the answers to your other questions, but i can help you on this one . . .

Quote
is der any way by testing if the chip is working or nt.
the easiest test is to make a digital output pin go high, then use a multimeter to measure if the pin is high or low.

Offline Kohanbash

  • Supreme Robot
  • *****
  • Posts: 430
  • Helpful? 1
Re: regarding MPLAB and PIC...
« Reply #2 on: March 07, 2007, 09:11:43 PM »
__config is an assembler directive that indicates the configuration bits to use. if you set the config options than you don't need to use the GUI to set compile options when programming the device.

the config bits are code protect, watchdog timer, power up timer,  and setting the oscillator type. The code protect bits are kind of complicated (the easiest is to disable them by using all 1's or h'3FF', but the other bits are simple to figure out and add on.

I don't know much about the ~PWRTE other than that its the power up timer and it is usually set to enable (ie '0').

Note: their are 2 underbars in front of the config (ie. 2 x _ = __config)
« Last Edit: March 07, 2007, 09:26:43 PM by sdk32285 »
Robots for Roboticists Blog - http://robotsforroboticists.com/

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: regarding MPLAB and PIC...
« Reply #3 on: March 07, 2007, 09:46:55 PM »
sounds exactly like fuse settings for AVR microcontrollers . . .

Offline JesseWelling

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 707
  • Helpful? 0
  • Only You Can Build A Robot!
Re: regarding MPLAB and PIC...
« Reply #4 on: March 07, 2007, 10:46:20 PM »
pretty much. I was trying to dig up my old code for my goldfish bot. I think I used the config for fuse programing.
but yea my avr recently broke and became unresponsive  :'( good thing they're only $49.

Offline Hal9000

  • Supreme Robot
  • *****
  • Posts: 338
  • Helpful? 0
Re: regarding MPLAB and PIC...
« Reply #5 on: March 08, 2007, 07:35:35 AM »
Yeah, these are all fuse settings I think.

All I can really say is that if you go onto the Microchip website then there are datasheets and stuff to flick through.

I've only just got used to using them myself, and it is a useful thing to know how to do!
"The truth is, you can't hide from the truth, cos the truth is all there is" - Handsome Boy Modeling School

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: regarding MPLAB and PIC...
« Reply #6 on: March 08, 2007, 10:08:32 AM »
just a note . . . be very careful when changing fuse settings . . .

i broke several AVR cause I didnt know what I was doing . . .

Offline Hal9000

  • Supreme Robot
  • *****
  • Posts: 338
  • Helpful? 0
Re: regarding MPLAB and PIC...
« Reply #7 on: March 08, 2007, 12:39:20 PM »
Surely fuse settings only mean stuff like...........I think when I ticked the box for low voltage programming, the program halted every time I went near it.

It didn't damage the device though. Can it really damage stuff?
"The truth is, you can't hide from the truth, cos the truth is all there is" - Handsome Boy Modeling School

Offline JesseWelling

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 707
  • Helpful? 0
  • Only You Can Build A Robot!
Re: regarding MPLAB and PIC...
« Reply #8 on: March 08, 2007, 01:16:49 PM »
yea if you burn the "No more burning fuse" it won't program any more.

Offline Hal9000

  • Supreme Robot
  • *****
  • Posts: 338
  • Helpful? 0
Re: regarding MPLAB and PIC...
« Reply #9 on: March 08, 2007, 01:45:20 PM »
Woah. never saw that one!
"The truth is, you can't hide from the truth, cos the truth is all there is" - Handsome Boy Modeling School

Offline JesseWelling

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 707
  • Helpful? 0
  • Only You Can Build A Robot!
Re: regarding MPLAB and PIC...
« Reply #10 on: March 08, 2007, 03:38:57 PM »
I don't remember what it's called but most chips these days have them.
Mostly the fuses deal with clock scaling and eeprom writing and stuff like that.

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: regarding MPLAB and PIC...
« Reply #11 on: March 08, 2007, 10:42:53 PM »
if you set the fuse to the wrong timer speed, the AVR wont be programmable anymore unless you get a new crystal for that speed . . .

Offline Hal9000

  • Supreme Robot
  • *****
  • Posts: 338
  • Helpful? 0
Re: regarding MPLAB and PIC...
« Reply #12 on: March 09, 2007, 03:40:04 AM »
Ohh, right I see.

Mainly I just click on HS or INT (High speed or Internal Oscillator) so it's always ok
"The truth is, you can't hide from the truth, cos the truth is all there is" - Handsome Boy Modeling School

 


Get Your Ad Here

data_list