2
\$\begingroup\$

I'm trying to intercept the signals between an old Elan uC and a HT-1622 LCD driver using a PIC18F14K50. There are 3 lines that are connected to the IOs of the uC: CS, WR(write clk) and DATA. At first sight it looks pretty simple, I just soldered 3 cables between the inputs on the HT-1622 and RB4, RB5 and RB6 on the PIC, and then I configured the registers like this:

TRISB = 1;   // set all pins on port b as inputs
ANSELH = 0; // digital inputs
WPUB = 0;  // disable the pull-up resistor

The problem arises when the PIC is powered on, the LCD driver stops working as it should, and the signals I get on the PIC inputs aren't valid (they're always 1). Once I disconnect VCC on the PIC, the LCD Driver works again. So it seems I'm missing something, any thoughts?

\$\endgroup\$
  • \$\begingroup\$ try using hex instead of decimal values for setting the bits, for example WPUB = 0x00 \$\endgroup\$ – 1p2r3k4t Nov 4 '13 at 14:46
  • 1
    \$\begingroup\$ Yes, I ended using a binary value, but an hex value does the trick as well. Thank you! \$\endgroup\$ – Hardy Nov 4 '13 at 14:49
  • \$\begingroup\$ you're welcome, there is another register that affects pull ups, option_reg, take a look if you want if you will need it in the future \$\endgroup\$ – 1p2r3k4t Nov 4 '13 at 14:52
2
\$\begingroup\$

TRISB = 1

This sets TRISB to 0x01: RB0 is input, all others are outputs.

\$\endgroup\$
  • \$\begingroup\$ Wow! You're absolutely right, what a dumb mistake. You saved my day. Thank you very much! \$\endgroup\$ – Hardy Nov 4 '13 at 14:47
  • 1
    \$\begingroup\$ Enlightenment comes from having been there ... \$\endgroup\$ – Wouter van Ooijen Nov 4 '13 at 15:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.