problem with sending data using RF module - Page 2


Closed Thread
Page 2 of 2 FirstFirst 12
Results 41 to 52 of 52
  1. #41
    Join Date
    Mar 2008
    Posts
    19


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mister_e View Post
    I never used those ICs... maybe you could some something in this document
    http://rentron.com/remote_control/remotes.pdf

    It show different value for the resistor. I didn't read the according datasheet to see if it affect anything though.

    Maybe you screw the OSC signal with your probe.. use a scope instead, set your probe to 10X (or 100X if you have any) and see what happen.

    TE pin should be tied low too unless the oscillator won't run.. as per Their Block Diagram (page 2) in their datasheet.
    http://www.holtek.com/pdf/consumer/2_12ev110.pdf

    As usual, Before you attach your RF modules, try direct connection, Dout to Din of your Holtek ICs.

    HTH
    Thanks for the reply.
    I already test the holtek IC using direct connection but the result is still the same.No noise but The Rx cannot receive the data and my LCD just show static word "BUS15". Maybe there is something wrong with the code.I post the code below.Can you check it for me??

    Tx part

    '
    ' TX code
    ' =======
    '
    @ device HS_OSC, LVP_OFF
    define OSC 20

    DEFINE LCD_DREG PORTC 'LCD data port
    DEFINE LCD_DBIT 0 'LCD data starting bit 0 or 4
    DEFINE LCD_RSREG PORTB 'LCD register select port
    DEFINE LCD_RSBIT 7 'LCD register select bit
    DEFINE LCD_EREG PORTB 'LCD enable port
    DEFINE LCD_EBIT 5 'LCD enable bit
    DEFINE LCD_RWREG PORTB 'LCD read/write port
    DEFINE LCD_RWBIT 6 'LCD read/write bit
    DEFINE LCD_BITS 8;4 'LCD bus size 4 or 8
    DEFINE LCD_LINES 2 'Number lines on LCD
    DEFINE LCD_COMMANDUS 2000 'Command delay time in us
    DEFINE LCD_DATAUS 50 'Data delay time in us

    TransmitterPIN VAR PORTA.0

    DEFINE CHAR_PACING 500

    TRISA = 0 'Set port A as output
    TRISB = 0 'Set port B as output
    TRISC = 0 'Set port C as output
    TRISD = 0 'Set port D as output

    ' Define program variables
    INCLUDE "modedefs.bas"
    col var byte ' Keypad column
    row var byte ' Keypad row
    key var byte ' Key value
    Synk VAR BYTE
    Synk = $55

    ADCON1 = 7 ' Make PORTA and PORTE digital

    low PORTB.6 'Set the R/W bit to low
    High TransmitterPin
    Pause 500 ' Wait for LCD to start
    Lcdout $fe, 1, "Key In Bus ID" ' Display sign on message

    loop:
    Gosub getkey ' Get a key from the keypad
    Lcdout $FE, $C0, "BUS",DEC2 key ' Display ASCII key number
    PORTA=KEY
    Goto loop ' Do it forever

    ' Subroutine to get a key from keypad
    getkey:
    PORTD = 0 ' All output pins low
    TRISD = $f0 ' Bottom 4 pins out, top 4 pins in
    WHILE PORTD != $F0 : wEND ' Wait 'till all key=up
    PAUSE 50 ' Debounce

    ScanKeypad:
    For col = 0 to 3 '
    TRISD=~(DCD COL) ' Set one I/O to output
    PAUSEUS 5 ' wait a little bit to avoid
    ' erratic results
    '
    ROW=ncd((~(PORTD>>4)) & $f) ' read row
    '
    IF ROW THEN ' Any key pressed?
    key = ((row-1)*4)+ col+1' --- YES convert key value
    return ' and getout of here
    ENDIF '
    NEXT '
    Goto ScanKeypad ' No keys down, go look again


    Rx Part

    '
    ' RX code
    ' =======
    '
    @ device HS_OSC, LVP_OFF
    define OSC 20

    DEFINE LCD_DREG PORTC 'LCD data port
    DEFINE LCD_DBIT 0 'LCD data starting bit 0 or 4
    DEFINE LCD_RSREG PORTB 'LCD register select port
    DEFINE LCD_RSBIT 7 'LCD register select bit
    DEFINE LCD_EREG PORTB 'LCD enable port
    DEFINE LCD_EBIT 5 'LCD enable bit
    DEFINE LCD_RWREG PORTB 'LCD read/write port
    DEFINE LCD_RWBIT 6 'LCD read/write bit
    DEFINE LCD_BITS 8 'LCD bus size 4 or 8
    DEFINE LCD_LINES 2 'Number lines on LCD
    DEFINE LCD_COMMANDUS 2000 'Command delay time in us
    DEFINE LCD_DATAUS 50 'Data delay time in us

    TRISA = 255 ' PORTA as input
    TRISB = 0 ' Set port B as output
    TRISC = 0 ' Set port C as output
    TRISD = 0 ' Set port D as output

    ReciverPIN VAR PORTA.0

    ADCON1 = 7 ' Alla digitala

    INCLUDE "modedefs.bas"
    YourByteVar var byte

    low PORTB.6 'Set the R/W bit to low
    pause 500 'wait until the LCD initializes
    LCDOUT $FE,1, "Receiving Bus ID"

    Main:
    YourByteVar=PORTA & $0F
    Lcdout $FE,$C0,"BUS", DEC2 YourByteVar
    GOTO Main

  2. #42
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    There's nothing wrong in your code, has to be a hardware problem.

    Scope the DO of your Encoder.. anything going out of it?

    IF so, erm... why the decoder don't work... mmm let me guess, this Resistor for the OSC? Could be, did you tried with both value in the first PDF i sent you?
    Last edited by mister_e; - 8th April 2008 at 19:04.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  3. #43
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    Have you tested the HT-12E directly wired to the HT-12D (with a common ground), without
    a microcontroller in the circuit, and still seen no response on the decoder outputs?

    If the direct-connect test fails, then I would suspect one of the following;

    1. You have a different address on the decoder than what's set on the encoder.
    2. You have no common ground between the two ICs.
    3. You have a bad encoder or decoder.

    The encoder data out to decoder data in is the 1st test we recommend to anyone having
    problems. This test helps determine if the problem is with the encoder/decoder ICs or the RF
    stage.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  4. #44
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Bruce, just for curiosity sake, what happen if all addresses pins are left open?
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  5. #45
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    Hi Steve,

    Most Holtek encder/decoder ICs have internal pull-ups, so floating these pins is the same
    as connecting them to Vcc. This should be in the data sheet. The 8-bit series are tri-state.

    But I never allow them to float. Especially in an application with an oscillator or embedded
    controller that's going to indroduce a ton of digital switching noise to the power supply rails.

    I've only seen maybe 1 in 10K failures with a set of Holtek encoder/decoder ICs. 9 times out
    of 10 it's something simple like noise, a single bit difference in the address, bad connection,
    wrong oscillator resistor value (voltage dependant), or just plain wired wrong that's the
    cause of failure.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  6. #46
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    As you know, i'm not a "left unused pin floating" fan. Was just for my own curiosity.. yeah datasheet says it could be left unconnected but.. erm...
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  7. #47
    Join Date
    Mar 2008
    Posts
    19


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mister_e View Post
    There's nothing wrong in your code, has to be a hardware problem.

    Scope the DO of your Encoder.. anything going out of it?

    IF so, erm... why the decoder don't work... mmm let me guess, this Resistor for the OSC? Could be, did you tried with both value in the first PDF i sent you?
    I use absolutely the same value of resistor in the PDF but the encoder/decoder still not function with direct connection.I can assure that Both Ground,Dout and Din pin was connected in the right position after chek it a few times. I'm curious about "transmitterPin Var portA.0"..
    Do I need to put it in my program if use HT12E and HT12D ?

  8. #48
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    There's no real big deal with that var, the only thing is HIGH TransmitterPIN at the begining... but this should send you some data at the begining, says your receiver should show BUS01 untill you press on your Keypad. no real harm at all...
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  9. #49
    Join Date
    Mar 2008
    Posts
    19


    Did you find this post helpful? Yes | No

    Default

    I already check my Dout and Din pin at HT12E/HT12D using Oscilloscope but the result show nothing .Only a long straight line shows at scope.It means No output/input from my HT12E and HT12D either I'm using direct connection or not.The resistor value for my OSC pin is exactly the same with what is listed in rentron pdf. But mr.Bruce said earlier that the resistor's value depends on voltage supply at HT12E/HT12D .So I check my voltage supply at vcc pin and I got 5.04 for HT12E and 5.06 for HT12D.Actually how to calculate the resistor value for OSC if it's really depends on voltage supply??

  10. #50
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Shouldn't be that critical for few millivolts. Are your Encoder/decoders address pins tied to ground as in the document i sent?
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  11. #51
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    You'll see a chart in the data sheet for the HT12E and HT12D that shows how to select
    oscillator resistor values.

    I normally use 33K for the decoder when operating at 5 volts. Locate 5 volts on the
    bottom of the chart in your HT12D data sheet, and follow the vertical line up to where
    the line from 33K on the right crosses it.

    This indicates just a tad >200kHz internal oscillator speed at 5 volts with 33K.

    Now look just below the chart where it states The recommended oscillator frequency is
    fOSCD (decoder) should be about equal to 50 x fOSCE (HT12E encoder).

    Now follow the vertical line up from 5 volts in the HT12E data sheet to where the line
    from 750K crosses. Just short of 4kHz.

    With +/- 5% resistors, you're in the ball-park.

    If you have a scope you can experiment a bit with oscillator resistors to see the effect
    changing them has on the encoder data output signal.

    At any rate, if you're getting nothing on the data output pin of your HT12E when /TE is
    at ground, then I would suspect you have a bad encoder.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  12. #52
    Join Date
    Mar 2008
    Posts
    19


    Did you find this post helpful? Yes | No

    Unhappy

    Quote Originally Posted by mister_e View Post
    Shouldn't be that critical for few millivolts. Are your Encoder/decoders address pins tied to ground as in the document i sent?
    Yes.All the Address pin for both encoder/decoder was tied low. I also connect the TE pin to GND for HT12E,but still no data receive at Rx. I'm not assuming that both encoder/decoder is damage because I have extra pair for HT12E and HT12D. when I use it, the result is same with the previous pair I have.the Holtek's data sheet say that the VT pin at HT12D will goes high to indicate valid transmission but my VT pin always LOW.
    Last edited by rano_zen06; - 10th April 2008 at 18:18.

Similar Threads

  1. Using Nokia LCD
    By BobP in forum mel PIC BASIC Pro
    Replies: 300
    Last Post: - 3rd May 2018, 04:47
  2. Read/Write Problem
    By Tobias in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 10th February 2010, 01:51
  3. Big characters on HD44780 4x20
    By erpalma in forum mel PIC BASIC Pro
    Replies: 23
    Last Post: - 7th January 2007, 02:21
  4. LCD + bar graph
    By DynamoBen in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 5th October 2005, 14:50
  5. Sinus calculating !
    By Don Mario in forum mel PIC BASIC Pro
    Replies: 29
    Last Post: - 28th November 2004, 23:56

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