Welcome into PIC world


Closed Thread
Results 1 to 25 of 25

Hybrid View

  1. #1
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default Wow edit goes away fast

    Ok I think you have not selected the correct chip in Micro Code Studio, and that is why your hex is different. Look at the tool bar and find the selection box and select the PIC you are using, then press F9 to compile. You will need to inspect this box before you compile each time because sometimes it changes without your help.
    EDIT: Well . . .I just looked at the attachment and you do have the correct chip selected . . .hmmmm interesting.
    <br>EDIT2: Had a second look at the attachment and saw it was MEPROG not MCS, so what I said before the edit stands, In MCS make sure the appropriate PIC is selected and recompile.
    Last edited by Archangel; - 29th April 2009 at 03:33.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  2. #2
    Join Date
    Apr 2009
    Posts
    11


    Did you find this post helpful? Yes | No

    Default Hi Joe

    Here is how i did it

    I selected 16F84A from the drop down in MCS and F9 to compile one it is compiled without any errors then i press F11 to program it , once pressing F11 it compiles again and opens up Melabs Programmer window, here i made disabled WatchDog and Powe up time disabled.

    One selected the Pic16F84A from the drop down i click on "Program".

    Thats how i did.................


    If you guys have VNC i can share my desktop Joe.

  3. #3
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530


    Did you find this post helpful? Yes | No

    Default

    The hex files seem to be the same. After compliling, I get one like post #13 if I look at the format my MeLabs programmer displays, but the hex file it uses looks just like post #15. So we must all be compiling the same thing. At least that's something! I have not been able to find my pic16f84a. I have not used those for a long time. The 16f84a has so few settings to begin with, that there isn't a lot to get wrong in the config fuses.

    I saw that you have your osc set to 4 mhz. Can you confirm that your resonator is really 4 mhz? If it was 8 to 10 mhz, you should be setting it for HS and not XT.

    By the way, do you have any other resonators, or crystals you could try?

  4. #4
    Join Date
    Apr 2009
    Posts
    11


    Did you find this post helpful? Yes | No

    Default

    Hi I have the following
    a). 4.00 GR
    b). F0x040A 4.000 (with this i tried 4.7 / 220 / 10 PF's)

    i tried with both , may i will try with a new Pic16f84a.
    I dont get it when i take off the VSS then the led is constantly lighted up.

    if i keep the multimeter to the pin RB0 then the light comes up steadily.
    power at that time would be 0.79 and at MCLR to VSS it is 1.24 volts.

    should i change the watchdog / powerup timer ON. and try...?
    how much power should i get at the pin?

  5. #5
    Join Date
    Apr 2009
    Posts
    11


    Did you find this post helpful? Yes | No

    Default

    Here is the code in MCS

    @ DEVICE pic16F84A
    define OSC 4
    TrisB = %00000000

    loop:
    High PORTB.0 ' Turn on LED connected to PORTB.0
    Pause 1000 ' Delay for .5 seconds

    Low PORTB.0 ' Turn off LED connected to PORTB.0
    Pause 1000 ' Delay for .5 seconds

    Goto loop ' Go back to loop and blink LED forever
    End


    when the MeProg popsup the hex values are as follows,

    0000- 2828 018f 008e 30ff 078e 1c03 078f 1c03
    0008- 2823 3003 008d 30df 200f 2803 018d 3ee8
    0010- 008c 098d 30fc 1c03 2818 078c 1803 2815
    0018- 078c 0064 0f8d 2815 180c 281e 1c8c 2822
    0020- 0000 2822 0008 1383 1303 1283 0064 0008
    0028- 1683 0186 1283 1406 1683 1006 1283 3003
    0030- 008f 30e8 2002 1006 1683 1006 1283 3003
    0038- 008f 30e8 2002 282b 0063 283c

    but when i program it then the values changes and displays like this.

    0000- 003c 018f 008e 30ff 078e 1c03 078f 1c03
    0008- 2823 3003 008d 30df 200f 2803 018d 3ee8
    0010- 008c 098d 30fc 1c03 2818 078c 1803 2815
    0018- 078c 0064 0f8d 2815 180c 281e 1c8c 2822
    0020- 0000 2822 0008 1383 1303 1283 0064 0008
    0028- 1683 0186 1283 1406 1683 1006 1283 3003
    0030- 008f 30e8 2002 1006 1683 1006 1283 3003
    0038- 008f 30e8 2002 282b 0063 283c


    is it right?

  6. #6
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530


    Did you find this post helpful? Yes | No

    Default

    Your resonator probably has 15 pf, which is within what the data sheet says it should be. The 10 pf caps you have do not quite meet the data sheet specs for the other crystal you have. I do not know whether this would mean it won't work, or if it just would not be ideal (probably not ideal).

    I think that mclr should be very close to vdd. So if it is just 1.24v or so, something is wrong. What is your vdd voltage? Is it also 1.24v?

    Sounds like the voltage is the problem.

  7. #7
    Join Date
    Apr 2009
    Posts
    11


    Did you find this post helpful? Yes | No

    Default

    VDD is 5.08 volts.
    at mclr one side it is giving 5.08volts and the other side where the pin 4 is connected it is 1.24 volts.

  8. #8
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530


    Did you find this post helpful? Yes | No

    Default

    Well, not sure what is causing it, but on an healthy chip, you should be seeing between 4 and 5 v on the mclr pin. If you seem to be having enough voltage everywhere else, with no outputs from the chip accidentally going directly to ground, etc, then it seems like you have an unhappy PIC.

  9. #9
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by shafi008 View Post
    Hi I have the following
    a). 4.00 GR
    b). F0x040A 4.000 (with this i tried 4.7 / 220 / 10 PF's)

    i tried with both , may i will try with a new Pic16f84a.
    I dont get it when i take off the VSS then the led is constantly lighted up.

    if i keep the multimeter to the pin RB0 then the light comes up steadily.
    power at that time would be 0.79 and at MCLR to VSS it is 1.24 volts.

    should i change the watchdog / powerup timer ON. and try...?
    how much power should i get at the pin?
    If you disconnect VSS the power flows through the PIC as though it were a resistor. I compiled with default configs, powerup timer enabled and WDT on. Have you tried reading back your hex from the PIC ? Maybe it is not programming at all. That could happen if the wrong COM port is selected, or programmer is jumpered wrong.
    EDIT: try copy paste the hex I posted into your programmer and see if it blinks. BTW WDT and Power up timer are actually good things unless they somehow interfere (like when using sleep) Powerup allows PIC to wait for power to get stable B4 booting up and WTD resets a stalled out PIC.
    Last edited by Archangel; - 29th April 2009 at 06:41.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  10. #10
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    OK I just downloaded ME PROG and set it up . . and that is where the hex you are using came from, it is a default sample hex, not your hex.
    When you click File . . . Open . . . The window that opens will list a directory tree and file name. You have to direct it to YOUR hex file located in Your PBP directory in whichever subdirectory you chose to save YOUR code in. That is why it is not working for you . . . Damn, it is the same . . . Hmmmm . . . OK again maybe the programmer isn't programming due to incorrect port.
    Last edited by Archangel; - 29th April 2009 at 06:56.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

Similar Threads

  1. SMS via pic
    By kenandere in forum GSM
    Replies: 15
    Last Post: - 10th March 2010, 10:00
  2. Replies: 67
    Last Post: - 8th December 2009, 02:27
  3. HSERIN & Interupts (aka controlling PIC programs from a remote PC)
    By HankMcSpank in forum mel PIC BASIC Pro
    Replies: 16
    Last Post: - 17th June 2009, 14:46
  4. pic to pic ir link versus wired link : help please anyone
    By xnihilo in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 30th May 2008, 21:01
  5. Serial Pic to Pic using HSER
    By Chadhammer in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 11th March 2005, 23:14

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts