PIC30f4012 Problems


Closed Thread
Results 1 to 5 of 5

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Insane View Post
    Hi,

    Were a group doing a final year project.
    Part of this project is to get a BLDC Motor spinning.
    The story goes as follows...

    We had the motor running ... all sweet, usually we could have the motor running whilst interupting for a few seconds to program the chip with a slightly modified code, and then the motor would continue to run.

    However.... one day when programming the chip, the motor stopped and has never spun since. We had PWM working as outputs when the hall sensors were in specific positions and after this download of the code, we had NOTHING.

    We swapped chips to another on which had the working code on it... motor working all sweet again... reprogrammed it .... FAIL.

    Now after checking over everything for the last week still to no avail, we cannot even write and produce a simple "Turn on a Port" program and have it working on a breadboard.

    Weve tried different chips, computers, PICKITS(Another PICKIT3 aswell as another PICKIT2).

    The program builds fine and the program is verified after programming... everything happens as it should except for any sort of output at the pins..

    Were using PIC30f4012 with PICKIT3, running MPLAB IDE v8.30 with C30 compiler.

    At the moment all weve got is the In-Circuit-Programming and the chip on the breadboard.

    The basic code is below for tuning on an LED at each port listed in the code.

    ----------------------------------------
    #include "htc.h"
    #include "p30f4012.h"
    #include "stdlib.h"

    void init(void)
    {
    ADPCFG = 0xFFFC;
    TRISB = 0b000000;
    TRISD = 0b00;

    TRISC = 0x9fff; // RC13 and RC14 are outputs

    TRISD = 0xfffc; // RD0 & RD1 are outputs

    TRISE = 0xffc0; // RE0 - RE5 (PWMs) are outputs

    PORTF = 0;
    TRISF = 0xffff;
    }


    void main(void)
    {
    init();
    while(1){

    PORTBbits.RB1 = 1;
    PORTDbits.RD1 = 1;
    PORTDbits.RD0 = 1;

    }
    }


    --------------------------------------



    Thanks all, hope you can state the obvious!!
    Wow, where do I start? The obvious, PIC BASIC & PBP is not "C", PIC Basic & PBP does not do 16 or 32 bit PICs, Don't want to send anyone away still hungry . . . Sounds like your "NEW" code has a very glaring problem, I would concentrate on what is different from what worked. Have you changed the configs without realizing it ? Did you upgrade the compiler ?
    Last edited by Archangel; - 28th July 2009 at 09:43.
    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. Problems programming
    By Lionheart in forum General
    Replies: 4
    Last Post: - 7th December 2008, 17:51
  2. 2 PWM in 16F690 problems
    By ciendavila in forum mel PIC BASIC
    Replies: 9
    Last Post: - 27th April 2008, 10:03
  3. bootloader Freqout problems
    By handgio in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 5th December 2007, 14:38
  4. Input problems
    By ALFRED in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 23rd July 2006, 22:02
  5. HSEROUT Problems
    By SergioRM in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 8th April 2005, 00:17

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