12F683 - basic code not working


Closed Thread
Results 1 to 40 of 57

Hybrid View

  1. #1
    Join Date
    Sep 2010
    Location
    Las Vegas, NV
    Posts
    305


    Did you find this post helpful? Yes | No

    Default Re: 12F683 - basic code not working

    I'm assuming your using PBP3 and to do configs you need to do them like this and both "config" lines need to be in caps. I know PBP2.6 was different but with either version both "config" lines need to be in caps.

    #CONFIG
    ;configuration directives in Assembly Language
    #ENDCONFIG

    TRISIO on the 12F683 is only 6 bits wide so I'm wondering if you need to change it to TRISIO = %111110. I think when you set the TRISIO and the GPIO as input and low respectively you'll always have a low at GPIO.0. When you set the pin low and told it to wait for a low it did what you told it to do. That is go to the demo subroutine. Since you changed it to =1 you had a state change and the chip could sense that. The reply by Acetronics2 did that by using the ! sign.

    Your second take on the subroutine and endif look better.

    As usual I'll await for someone to tell I'm wrong.

  2. #2
    Join Date
    Oct 2009
    Posts
    583


    Did you find this post helpful? Yes | No

    Default Re: 12F683 - basic code not working

    Quote Originally Posted by AvionicsMaster1 View Post
    I'm assuming your using PBP3 .
    Sorry, wrong assumption - using 2.60

    Quick question and slightly off topic, but related to this project... I'm using an H-bridge to control the motor as I need it to be bi-directional. I've been experimenting with some NPN and PNP transistors that I had in my hobby box, BC639 and BC640 and have had a small low current motor running from the PIC. However the actual motor I will be using is a 540 type with a 6:1 gearing. Even though it will be running from a 3v supply (separate to the 5v pic supply) my guess is that the current might be too high for the BC639 / 640 transistors. Can anyone advise if using these transistors would be OK for such a motor, or should I use something like the TIP220 transistors ??
    Attached Images Attached Images  

Similar Threads

  1. 12F683 - Pin1 not working
    By ruijc in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 8th February 2014, 17:38
  2. 12F683 Maths and code genius reqd.
    By retepsnikrep in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 1st January 2014, 08:44
  3. please help with 12f683 pwm code
    By haidar in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 22nd May 2013, 21:25
  4. Problem converting 12F683 code to 12F1840
    By RossWaddell in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 14th March 2013, 01:55
  5. Working code but my layman approach uses too much code space
    By Christopher4187 in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 14th December 2012, 20:44

Members who have read this thread : 2

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