Pic 18f4620


Closed Thread
Results 1 to 4 of 4

Thread: Pic 18f4620

  1. #1
    Join Date
    May 2009
    Posts
    2

    Default Pic 18f4620

    Hi, I am beginning to program pic with pickit 2; I use micro code studio as compiler, (pbp). I have a problem with pic 18f4620.

    I make this simple program, lampled, but the flashing of the led does not correspond with the program( 1 second on, 1 second off), synchronism lacks.

    This is the program:
    '************************************************* ***************
    '* Name : UNTITLED.BAS *
    '* Author : [select VIEW...EDITOR OPTIONS] *
    '* Notice : Copyright (c) 2009 [select VIEW...EDITOR OPTIONS] *
    '* : All Rights Reserved *
    '* Date : 27/04/2009 *
    '* Version : 1.0 *
    '* Notes : *
    '* : *
    '************************************************* ***************

    DEFINE OSC
    TRISB = %00000000
    PORTB = 0

    START:
    PORTB.1 = 1
    PAUSE 1000
    PORTB.1 = 0
    PAUSE 1000
    GOTO START
    ++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++

    The problem is the configuration fuses?
    Tank's Davide.

  2. #2
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Yes and No, you haven't told us which osc speed you're using

    Problem lie more on PORTB.1 and it's multiplexed Analog To digital converter. You want to disable it before using it as digital i/o

    Here's some link for you, keep them handy somewhere.

    PortA Doesn't Work
    http://www.picbasic.co.uk/forum/showthread.php?t=561

    All Digital
    http://www.picbasic.co.uk/forum/showthread.php?t=11100

    Presetting Configuration Fuses (PIC Defines) into your Program
    http://www.picbasic.co.uk/forum/showthread.php?t=543
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  3. #3
    Join Date
    May 2009
    Posts
    2


    Did you find this post helpful? Yes | No

    Default

    '************************************************* ***************
    '* Name : UNTITLED.BAS *
    '* Author : [select VIEW...EDITOR OPTIONS] *
    '* Notice : Copyright (c) 2009 [select VIEW...EDITOR OPTIONS] *
    '* : All Rights Reserved *
    '* Date : 27/04/2009 *
    '* Version : 1.0 *
    '* Notes : *
    '* : *
    '************************************************* ***************

    DEFINE OSC 20
    TRISB = %00000000
    PORTB = 0

    START:
    PORTB.1 = 1
    PAUSE 1000
    PORTB.1 = 0
    PAUSE 1000
    GOTO START
    ++++++++++++++++++++++++++++++++++++++++++++++++++ ++


    The frequency is 20 MHz.

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


    Did you find this post helpful? Yes | No

    Default Configs Yes

    Hello Davide,
    You have no config settings in your code which indicates to me you are using the default config listed in the pbp\18f4620.inc file, which was designed for 4mhz operation, so you have to either change those configs, comment them out and put the correct ones into your code, or change your resonator and define to 4mhz. Look at the links provided by mister_e.
    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. 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
  4. Coding Style - PIC 18F4620 config fuses
    By BrianT in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 8th January 2008, 20:05
  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 : 1

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