Serin serout problem


Closed Thread
Results 1 to 40 of 337

Hybrid View

  1. #1
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default

    ok I am getting the voltage now
    I will be using this to ativate my h-bridge.
    also, I am trying to solder a small capacitor (0.1uF) on the terminal of my motor. The solder does not want to stay eith on the pin of the case of the motor, do you have any trick here?

  2. #2
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default Pins

    also,
    I dont usually use that and/or have seen this, but should we put resistors to ALL output pins of the microcontroller?
    Last edited by lerameur; - 26th January 2007 at 12:27.

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


    Did you find this post helpful? Yes | No

    Default pins

    Quote Originally Posted by lerameur View Post
    also,
    I dont usually use that and/or have seen this, but should we put resistors to ALL output pins of the microcontroller?
    When I used the word pin, I meant the literal piece of metal sticking out of the part. I guess I should have said leads.
    The opto coupler is made from 2 LEDs, 2 photo transistors. So in a word, Yes all the opto couplers LEDs should have series resistors.
    As far as your PIC goes, I (personally) never leave pins floating out in space, I always tie them to Power or Ground as appropriate to their respective conditions.
    I hope you found this to be of value.
    JS
    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.

  4. #4
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default

    so you are saying that you do put a resistor between the pin and anything that is connecet right, like an h-bridge or another microcontroller right

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


    Did you find this post helpful? Yes | No

    Default not always

    Quote Originally Posted by lerameur View Post
    so you are saying that you do put a resistor between the pin and anything that is connecet right, like an h-bridge or another microcontroller right
    The pic outputs are matched to TTL levels, you can connect them directly to 5 volt logic devices without resistors.
    A resistor is used anytime you need to limit the current to keep from smoking your PIC. look at the data sheet and see what the output ports can source or sink. What is the load you are putting on it? A 16f628A can sink or source 25 ma on each I/O pin and keep in the magic smoke. a resistor may be required in series to keep the current below the magic 25ma. In the case of these opto couplers a resistor is definately needed.
    So looking at the DATA sheet from the opto coupler, the diode operates on 1.25 volts at 20ma. If you are using a 5 volt supply then the formula is :
    5v - 1.25 v / .02 = 187.5 ohm so round up the closest say 200 ohm resistor and you are golden.
    Last edited by Archangel; - 28th January 2007 at 09:43. Reason: Add
    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.

  6. #6
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default

    Ok I am continuing my project.
    I get a compiling error for my If then loop:
    If I hide the two last line , then I dont get any error. But I need those lines. Any ideas?

    if portb.0 = 1 then goto Option1
    if portb.1 = 1 then goto Option2
    if portb.2 = 1 then goto Option3
    if portb.3 = 1 then goto stopping
    else goto stopping
    endif


    error:
    C:\PBP\MOTORG.BAS ERROR Line 62: Syntax error.
    C:\PBP\MOTORG.BAS ERROR Line 63: ENDIF without a matching IF..THEN.
    C:\PBP>

  7. #7
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by lerameur View Post
    Ok I am continuing my project.
    I get a compiling error for my If then loop:
    If I hide the two last line , then I dont get any error. But I need those lines. Any ideas?

    if portb.0 = 1 then goto Option1
    if portb.1 = 1 then goto Option2
    if portb.2 = 1 then goto Option3
    if portb.3 = 1 then goto stopping
    else goto stopping
    endif


    error:
    C:\PBP\MOTORG.BAS ERROR Line 62: Syntax error.
    C:\PBP\MOTORG.BAS ERROR Line 63: ENDIF without a matching IF..THEN.
    C:\PBP>
    if portb.3 = 1 then
    goto stopping
    else
    goto stopping
    endif

    You can't have that first 'goto stopping' on the same line as the if/then if you're using an if/then/else type statement

Similar Threads

  1. A Serial GLCD 128x64 Simple Project
    By Oldspring in forum Off Topic
    Replies: 0
    Last Post: - 8th March 2010, 21:58
  2. PIC16f877 code crosses boundary @800h
    By inventosrl in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 6th April 2009, 23:03
  3. serout and serin problem
    By nicolelawsc in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 11th April 2006, 20:44
  4. Replies: 11
    Last Post: - 13th July 2005, 20:26
  5. SerIn and SerOut
    By Dwayne in forum FAQ - Frequently Asked Questions
    Replies: 0
    Last Post: - 21st July 2004, 16:54

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