PIC18F4620 Programming problem


Closed Thread
Results 1 to 16 of 16

Hybrid View

  1. #1
    Join Date
    Dec 2008
    Posts
    21


    Did you find this post helpful? Yes | No

    Default

    I really appreciate you guys trying to help. The code that you see on my previous post makes the leds blinks, both porta.0 and portd.0. I do not know about other pics, but on the 18F4620 the port is digital as per the datasheet. If you want to use for ADC, then you must specify it on code. It is on chapter 19 of the datasheet. Again, the code works 100% when I use the Basic editor on the simulator or if I use assembler. I only use the basic editor of the simulator to write the code and create the hex file to then burn it on the chip.

    My point is, when I use MicroCode Studio to write code and I want to pass it to my chip, the code does not work. In other words, the leds do not blink. I think there might be something wrong or I am doing something wrong on my code.

  2. #2
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    but on the 18F4620 the port is digital as per the datasheet. If you want to use for ADC, then you must specify it on code.
    That is the part you have backwards. You have to make the pins digital.

    So... refer to the link I gave you and try
    Code:
    ADCON1=15
    Keep reading chapter 19 and look at
    REGISTER 19-2: ADCON1: A/D CONTROL REGISTER 1
    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    Dec 2008
    Posts
    21


    Did you find this post helpful? Yes | No

    Default

    I could think that it is why led on port a is not turning on, but what about led on port d.

    I have to leave to work now but I will defenetaly try your suggestion when I get back tonight.

  4. #4
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Looking at your code again. The
    DEFINE OSC 8
    leads me to believe you are using the internal OSC. If so try this
    Code:
    @ __CONFIG    _CONFIG1H, _OSC_INTIO67_1H
    @ __CONFIG    _CONFIG2H, _WDT_ON_2H & _WDTPS_512_2H
    @ __CONFIG    _CONFIG3H, _PBADEN_OFF_3H
    @ __CONFIG    _CONFIG4L, _LVP_OFF_4L & _XINST_OFF_4L
    in place of you config line.
    Dave
    Always wear safety glasses while programming.

  5. #5
    Join Date
    Dec 2008
    Posts
    21


    Did you find this post helpful? Yes | No

    Default

    Hey guys, tried both suggestions and still not working. My code looks like this:

    DEFINE LOADER_USED 1 'Bootloader Used
    '@ __CONFIG _CONFIG1H, _OSC_HS_1H
    @ __CONFIG _CONFIG1H, _OSC_INTIO67_1H
    @ __CONFIG _CONFIG2H, _WDT_ON_2H & _WDTPS_512_2H
    @ __CONFIG _CONFIG3H, _PBADEN_OFF_3H
    @ __CONFIG _CONFIG4L, _LVP_OFF_4L & _XINST_OFF_4L
    ADCON1=15
    DEFINE OSC 8
    loop:
    Serout2 PORTB.7,16468,["Testing123"] 'For PC
    High PORTA.0
    Low PORTD.0
    pause 1000
    Low PORTA.0
    High PORTD.0
    pause 1000
    Goto loop

    I still think that the problem could reside in MicroCode Studio. I will continue working on it tonight.

  6. #6
    fronkensteen's Avatar
    fronkensteen Guest


    Did you find this post helpful? Yes | No

    Default

    Decrease the pauses to pause 1 and see what happens.

  7. #7
    Join Date
    Dec 2008
    Posts
    21


    Did you find this post helpful? Yes | No

    Default

    Changed the pauses to 1, but nothing. No change.

Similar Threads

  1. 16F676 programming problem
    By Christopher4187 in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 18th May 2009, 17:39
  2. Programming Problem with PIC16F819
    By Dick Ivers in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 24th July 2007, 18:42
  3. Problem with Interrupt on PIC18F4620 PORTB
    By rookie in forum Off Topic
    Replies: 1
    Last Post: - 22nd March 2007, 01:34
  4. Problem programming the PIC16F648A
    By Edgardo_2 in forum General
    Replies: 2
    Last Post: - 29th December 2006, 00:02
  5. Problem with "on Interrupt" and PIC18F4620
    By philtep in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 21st September 2005, 02:24

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