I have tried the one using BC557 and BC337 transistor. I use it with PIC16F628A (running on internal oscillator) to transmit to PC (hyper terminal)..
However, the result is not good.. Maybe out of 10 tries, the computer only receive 1 time..
not sure whether is it because of the internal oscillator or because the UART alternative using BC557 and BC337 is not good..
anyway, does anybody know of a better max232 alternative which is low cost..?
If you're doing the RS232 in software, you can invert the data in the software, and you only require a single resistor to receive, and nothing at all to transmit - which is how the BASIC STAMP works.
How fast are you trying to run the RS232?, in my experience (over many years) 9600 baud is rock solid using the internal 628 oscillator.
The transistor version will only work reliably for half-duplex operation. If there is data being transmitted and received at the same time the data transmitted by your device may get corrupted.
If you're doing the RS232 in software, you can invert the data in the software, and you only require a single resistor to receive, and nothing at all to transmit - which is how the BASIC STAMP works.
How fast are you trying to run the RS232?, in my experience (over many years) 9600 baud is rock solid using the internal 628 oscillator.
I am using it in half duplex mode at 9600 baud.
What doews it mean by inverting the data in the software..? BTW, i am using Rx and RB1 (Rx) and RB2 (Tx)..
How do I connect the resistor..?
Maybe a diagram and an example might help me to understand what you are trying to say..
Hope it is not too troublesome..
Thanks in advance..
i am using CCS C compiler..
The routine is very basic and simple.. When the PIC starts to run, it will display something on the LCD, delay for 10 seconds and then send something using UART. As it sends out via UART, it will also display something on the LCD so that i know that the data has been sent..
Nigel,
When you say invert the data in the software, u mean i change the bit "1" to "0" and bit "0" to "1"..? for example, if I have 1 byte of data "10101010", i invert it to become "01010101" before I send it out..?
In doing this, I do not need to use any other components such as inverter gate or NAND gate..?
I only need to put 1 resistor (10K) between serial port (Pin 3 - TD) and PIC (RB1 - Rx) ..
Is it just like the picture below minus the zener diode and inverter gate..? **broken link removed**
Yes, just like that, one resistor - but you can't do it if you use the hardware USART, you need to write software UART routines (like in my tutorial) where you can simply invery both transmit and receive (by changing BCF to BSF, BSF to BCF for the transmit routine).
Yes, just like that, one resistor - but you can't do it if you use the hardware USART, you need to write software UART routines (like in my tutorial) where you can simply invery both transmit and receive (by changing BCF to BSF, BSF to BCF for the transmit routine).