• AVR Freaks

Hot!PIC16F505 NOT PROGRAMMING!

Author
Gouthami c v
Starting Member
  • Total Posts : 83
  • Reward points : 0
  • Joined: 2019/07/11 01:55:44
  • Location: 0
  • Status: offline
2019/11/20 02:13:50 (permalink)
0

PIC16F505 NOT PROGRAMMING!

Hi every one i am trying to program pic16f505 microcontroller but its not happening, i have writeen code to blink led, i have attached code here could anyone tell me solution.

 

// CONFIG
#pragma config OSC = IntRC_CLKOUTEN// Oscillator Selection bits (Internal RC oscillator/CLKOUT function on RB4/OSC2/CLKOUT pin)
#pragma config WDT = OFF // Watchdog Timer Enable bit (WDT disabled)
#pragma config CP = OFF // Code Protection bit (Code protection off)
#pragma config MCLRE = OFF // RB3/MCLR Pin Function Select bit (GP3/MCLR pin function is digital input, MCLR internally tied to VDD)
 
// #pragma config statements should precede project file includes.
// Use project enums instead of #define for ON and OFF.
 
#include <xc.h>
#define _XTAL_FREQ 8000000
#include <stdlib.h>
 
 
 
int main()
{
TRISB = 0b000000 ; //RB1 as Output PIN
TRISC = 0b000000 ; // = 0;

while(1)
{
/////////////////////////////////////////Initialising///////////////
RB0 = 1; //RED LED ON
__delay_ms(4000); // 4 Second Delay
RB0 = 0;
__delay_ms(10);
}
}
 

Thanking You.
#1

6 Replies Related Threads

    ric
    Super Member
    • Total Posts : 24638
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: offline
    Re: PIC16F505 NOT PROGRAMMING! 2019/11/20 04:06:10 (permalink)
    0
    So is RB0 high, low, or floating?
    You can't check it by eye. You won't see the LED go off for only 10ms.
     

    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #2
    Gouthami c v
    Starting Member
    • Total Posts : 83
    • Reward points : 0
    • Joined: 2019/07/11 01:55:44
    • Location: 0
    • Status: offline
    Re: PIC16F505 NOT PROGRAMMING! 2019/11/20 04:09:41 (permalink)
    0
    No its not getting program only 
     
     
    Thanking you.
    #3
    katela
    Super Member
    • Total Posts : 1468
    • Reward points : 0
    • Joined: 2013/06/11 05:25:18
    • Location: South Africa
    • Status: online
    Re: PIC16F505 NOT PROGRAMMING! 2019/11/20 04:25:30 (permalink)
    0
    Try to increase the OFF delay also to be able to see something. 10ms is too short.
    How is your LED connected to your PIC? I hope you connected it to RB0 and not RB1 as in your comments.

    Free online Microcontroller Tutorials and Projects for Hobbyists and students. From beginners to advanced. Website: www.studentcompanion.co.za
    YouTube Tutorials: https://www.youtube.com/StudentCompanionSA
    #4
    Gouthami c v
    Starting Member
    • Total Posts : 83
    • Reward points : 0
    • Joined: 2019/07/11 01:55:44
    • Location: 0
    • Status: offline
    Re: PIC16F505 NOT PROGRAMMING! 2019/11/20 04:54:08 (permalink)
    0
    Thank you for replying, i have connected led to RB0 only.
    Whenever i try to programming with pickit3 its not programming, i am getting error, i have attatched image what i am getting when i will program.
     
     
     
    Thanking you.

    Attached Image(s)

    #5
    ric
    Super Member
    • Total Posts : 24638
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: offline
    Re: PIC16F505 NOT PROGRAMMING! 2019/11/20 05:30:56 (permalink)
    0
    Why didn't you say that to start with?
    If it failed programming, it's irrelevant what you tried to program.
    Are you sure it is talking to your chip at all? What appears before the bit you showed?
    What programmer are you using, and how is it connected to the PIC?
     
     

    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #6
    NorthGuy
    Super Member
    • Total Posts : 5817
    • Reward points : 0
    • Joined: 2014/02/23 14:23:23
    • Location: Northern Canada
    • Status: offline
    Re: PIC16F505 NOT PROGRAMMING! 2019/11/20 12:29:46 (permalink)
    0
    Show the entire message (post the text, not picture). This PIC has OSCCAL calibration data, which is supposed to be read before erase. Does your programmer reads it Ok? What is your VDD voltage?
    #7
    Jump to:
    © 2019 APG vNext Commercial Version 4.5