Serin serout problem


Closed Thread
Results 1 to 40 of 337

Hybrid View

  1. #1
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by lerameur View Post
    as for the lCd that is entirely my fault,

    but are you saying opto couplers are not necessary?
    when should they be used. ?
    i just read a few reports of similar problem that where resolved this way.
    pic:
    http://www3.sympatico.ca/lerameur/PDR_0141.jpg
    Sorry guy...I can't make heads or tails of the picture in your last post.

  2. #2
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default

    I decided i am going to put relays instead of an H-bridge.
    I recently obtained some nice sensors from Taosinc.com. I wrote this program but it does not work. The datasheet is not complicated, but maybe I missed something. I seems that i need to put SI to high after the 129th clock. maybe I am not using the pulsin command right.


    datasheet:
    http://www.taosinc.com/images/produc...401R-LF-E4.PDF

    My program:
    sensor var byte: counter var byte : pulse var byte

    TRISB = %00000000
    TRISA = %11111111

    loop:

    'clock input on RB0
    'after 18 clock input at 1, count 111 clock cycles after the reset
    pulse = 0

    counting:
    Pulsin PortA.1,1,pulse
    pulse = pulse +1
    if pulse = 18 then goto continue
    goto counting

    continue:

    Pulsin PortA.1,1,pulse
    pulse = pulse +1
    if pulse = 130 then goto continue2
    goto counting

    continue2:
    porb.0 = 1 'Si is now high
    Pulsin PortA.1,1,pulse
    pulse = pulse +1
    if pulse = 131 then goto continue3
    goto continue2

    continue3:
    ADCON0.2 = 1 'Start Conversion
    porb.0 = 0 'put the SI back to zero
    ADCIN 0, sensor 'Read channel PORTA.0
    pause 50

    Lcdout $fe, 1 'Clear screen
    Lcdout "Sensor: ", Dec sensor
    Pause 200

    goto loop

    end

  3. #3
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default opto coupler

    I have bought the MCT6 chip (opto coupler)
    I grounded pin 3 and 5

    If I put a voltage a cross pin 4 should I get the same voltage across pin 6 ??

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by lerameur View Post
    I have bought the MCT6 chip (opto coupler)
    I grounded pin 3 and 5

    If I put a voltage a cross pin 4 should I get the same voltage across pin 6 ??
    NO. here is a link to the data sheet'
    http://www.fairchildsemi.com/ds/MC/MCT62.pdf
    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.

  5. #5
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default

    I actually did the the circuit shown on page 5

    http://www.ortodoxism.ro/datasheets/vishay/83645.pdf

    still do not work.

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


    Did you find this post helpful? Yes | No

    Default Step by step

    Ok leramuer,
    Since I am too lazy to read 288 pages of this post over, I am not going to ASSUME anything. So here goes; Current flow, not to be mistaken with electron flow, current flows from positive to negative. The arrows in LEDs and Transistors indicate the current flow direction. Maybe you know all this, like I said, I will assume nothing. (1) Anyway, if you have a pic which outputs logic High, then you hook that port to pin 1 or pin 4 of the opto coupler, and pins 2,3 would hook to ground.(2) If ypur PIC outputs logic low then you would hook the port to pin 2 or 3, pins 1 and 4 would hook to the positive supply. now if your relay has one leg hooked to positive then the other leg would hook to pin 6, or 7.
    If your relay has one leg hooked to ground, then the other end should hook to pin 5 or eight. As I said current flows in the direction the arrows point. It is that simple. CAUTION: Be sure to use current limiting resistors on the emitter side of the opto couplers as they only operate at 1.5v max 20ma so as not to fry them.
    Last edited by Archangel; - 26th January 2007 at 07:24.
    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.

  7. #7
    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?

Similar Threads

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