603,975 active members*
2,826 visitors online*
Register for free
Login

Thread: Pic Problem

Results 1 to 6 of 6
  1. #1
    Join Date
    May 2012
    Posts
    0

    Pic Problem

    I am having a problem with a small routine that I am trying to get to work. Basically I want 2 LED's to flash siultaneously on and of for a second. I have blown the pic and it sort of works but flash as its supposed to then starts flashing eratically. I really dont know where to bgin and some assistance would be great

  2. #2
    Join Date
    Jan 2010
    Posts
    12
    sorry only found your post now,can i help you or did you come right?

  3. #3
    Join Date
    Jan 2010
    Posts
    12
    You can buy flashing leds to start with but if you want to use a pic i would suggest buying yourself a pickit 2 or pickit 3 from microchip.This will develop your microcontroller skills alot because it comes with examples covering basic to advanced like subroutines.If you want to you can sent me detailed description of components used like a pic 12f507 etc.a drawing of your diagram could also help me a lot.How is your spares availability,if you want to i can sent you needed spares etc what you need from pretoria south africa as i see you are from zim.

  4. #4
    Join Date
    May 2012
    Posts
    0
    Hi This will be great as I often cant get some of the components in Zim. I have a Picstat plus and use mplab 8

    Below is my code the LED is flashing but not in a 1 second cycle. I am just using flashing LED' to get to understand basic pic language.

    I am looking for a suitable cutter to cut my PCB do you sell these.

    My big problem is I dont understand most of the terminology and instructions. My biggest problem at the moment is understanding the timing and seting it and understanding it.

    Thanks

    Rodney

    [email protected]

    LIST P=12F675
    INCLUDE <P12F675.INC>
    __CONFIG _INTRC_OSC_NOCLKOUT & _WDT_OFF & _PWRTE_ON & _MCLRE_OFF & _CP_OFF & _CPD_OFF
    ERRORLEVEL -302
    ;Equates
    COUNTVAL EQU 0X0F
    COUNT EQU 0X20
    ORG 0
    GOTO START
    ; DELAY SUBROUTINE
    DELAY:
    MOVLW COUNTVAL ; Reset outer counter
    MOVWF COUNT
    BANKSEL INTCON
    DELAY2:
    BCF INTCON,T0IF ; Clear TMR0 overflow flag
    DELAY3:
    BTFSS INTCON,T0IF ; Wait for TMR0 overflow
    GOTO DELAY3
    DECFSZ COUNT,1 ; Decrement outer counter
    GOTO DELAY2
    RETURN
    ; MAIN
    START:
    BANKSEL TRISIO ; Bank 1
    BCF TRISIO,2 ; Set RA2 to output (bit 2)
    MOVLW B'11010111' ; TMR0 using Fosc/4, Prescaler 1:256
    BANKSEL OPTION_REG
    MOVWF OPTION_REG
    LOOP:
    BANKSEL GPIO ; Bank 0
    BSF GPIO,2 ; Turn on RA2
    CALL DELAY
    BANKSEL GPIO
    BCF GPIO,2 ; Turn off RA2
    CALL DELAY
    GOTO LOOP
    END

  5. #5
    Join Date
    Jan 2010
    Posts
    12

  6. #6
    Join Date
    May 2005
    Posts
    35
    Use Flowcode it makes life very easy.

    Keith.

Similar Threads

  1. daewoo puma 12lb tape format problem/parameter problem
    By robb12877 in forum Daewoo/Doosan
    Replies: 0
    Last Post: 08-25-2011, 06:13 AM
  2. Replies: 5
    Last Post: 08-04-2010, 11:33 PM
  3. machine problem or software problem?
    By bcnc in forum Syil Products
    Replies: 8
    Last Post: 10-26-2009, 03:51 PM

Posting Permissions

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