Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

uart driver for pic16f877a

Status
Not open for further replies.
https://extremeelectronics.co.in/mi...c18f4520s-usart-pic-microcontroller-tutorial/


https://extremeelectronics.co.in/av...vr-microcontrollers-reading-and-writing-data/

U better go through the link which is displayed, you may get better points how to connect a pic to computer....

- - - Updated - - -

Hi,

Is it necessary to make use of MAX-232 level converter for communication with the hyperterminal or will the RS-232 cable take care of it?



http://extremeelectronics.co.in/micr...ller-tutorial/


http://extremeelectronics.co.in/avr-...-writing-data/

U better go through the link which is displayed, you may get better points how to connect a pic to computer....
 

Hi,

I checked the voltage level b/w the pin 6 and pin 15(GND) and it reads -9.34V. But still when I short the pin 13 and pin 14 of MAX-232 the loopback does'nt happen and I don't receive the data on RCREG. Is there any other problem?Please help!

Thankyou
 

It should work with pins 13 and 14 linked. The data leaves the PIC TX pin at 5V level, goes into pin 11 of the MAX232, leaves at RS232 levels on pin 14. Linking pin 14 to 13 should make the RS232 data come back out of the MAX232 at 5V levels again on pin 12 and go straight back into to PIC RX pin.

Can you try another MAX232 or if you haven't got one, try using the other transmitter and receiver pins instead. There are twio identical transmitters and two identical receivers insdide the IC.

Brian.
 

Hi,

I have a doubt regarding the pins13 and 14 of MAX-232. Pin 13 actually is the input pin which receives serially transmitted data at RS 232 logic level; connected to transmitter pin of PC serial port and pin 14 is the output pin which outputs the serially transmitted data at RS232 logic level; connected to receiver pin of PC serial port. Since it takes data from rs232 which is at different logic level than PIC's TTL logic level, is it possible to get the data reflected in RCREG of PIC,when I short the pins 13 and 14 of MAX232?Please clarify

Thankyou
 

Yes, it is correct.

PIC data is 0 = VSS, 1 = VDD
MAX232 converts this to RS232 levels. 0 = +12V, 1 = -12V which leave it on pin 14.
------- Pin 14 is linked to pin 13 to test the path -------------
MAX232 converts RS232 levels on pin 13 baxk to PIC levels at pin 12.

I'm trying to estanlish four things:
1. If yhe PIC TX and RX pins are linked, can it see it's own data - you have confirmed it can.
2. If the PC TX and RX pins are linked, can it see it's own data - you have confirmed it can.
3. if the MAX232 is linked at the PIC side, can the RXREG see it's own data sent from TXREG - you have conformed it can.
4 if the MAX 232 is linked at the PC side, can the RXREG see it's own data sent from TXREG - this is still not confirmed.

The levels on the logic side and RS232 sides of the MAX232 are completely incompatible but if you convert from one ot the other and back again, the device should appear transparent.

Brian.
 

Hi,

Linking MAX-232 at the PC side is nothing but shorting pins 13 and 14 right?When I tried it I am not getting data reflecting back from TXREG to RCREG. I am doubting if there is any problem with the MAX-232 IC. Because I have read many posts which tell this IC would fail after many hours of usage if there is a static shock at any point. So please tell me how I can test the IC?Or what other things can be the problem in this case?

Thankyou

- - - Updated - - -

Hi,

And about using the alternate TX RX pins on MAX232 chip. Pin 7 and pin8 act as alternate TX RX pins but these are not used in the PIC board as the internal connection between pin 13 to pin3 of rs232 connector(db9) and pin 14 to pin2(db9) is done inside the board. So if I again short pins7 and 8 of MAX232 then there will be 2 sets of TX RX operations happening. This is the problem I am facing. Please help me with a solution.

Thankyou
 

Well, if you feed a signal through two inverters you should end up with the same out as you put in. The MAX232 is simply an IC with an inverting transmitter and inverting receiver, the voltage levels are different but that doesn't matter. If you are saying this is what you see:

TXTREG ----(logic levels)---> MAX232 pin 14 ---(RS232 levels) ---> MAX232 pin 12 ---(Logic levels)---> RCREG. With MAX232 pins 13 and 14 linked.

Is not working, either the MAX232 is faulty, something else is connected to it and loading the signal or there is a break in the wiring.

The only other possibility is you are running at very high baud rates by overclocking the PIC or setting the baud rate > 120Kbps but even then over such a short link it would probably work.

Brian.
 

Hi,

I am checking if the IC is working properly. I checked the voltage between pin 16(VCC) and pin 15(GND) and it read 5V. Now I want to check the capacitors voltages but I don/t know the ranges and I am not able to get information about it. I am using MAX232CN IC. Please tel me the voltage ranges of the capacitors and any other tests to verify the IC.

Thankyou

- - - Updated - - -

Hi,

Here is the circuit diagram of the max232 which I am using.



Thankyou
 

The MAX232 has an internal charge pump so it can produce RS232 voltage levels from it's own 5V supply line. The high voltages are not stabilized so they may vary from one device to another but as a general rule you should find about +10V on pin 2 and about -10V on pin 6. The other capcitors have signals on them so a voltage measurement would not give a meaningful reading. If they have failed, the 10V would not be present though.

If you have the IC isolated from the rest of the circuit, power it up with capcitors connected and tie the logic inputs to ground, the outputs should go to about +10V. Then tie the logic inputs to 5V, the outputs should go to -10V, in other words, the polarity is inverted and the voltage swings from + to -.

Brian.

- - - Updated - - -

Problem solved - I think.

Looking at the diagram you posted, you have the transmit and receive crossed over. The PIC TX pin (RC6) should connect to pin 11 and the RX pin (RC7) to pin 12.

Brian.
 

Hi,

That was the schematic of the MAX232 which I got along with the development board. If according to what you say,the transmit and receive are crossed over,then how else can I rectify it?Because the IC is inbuilt and the connections are soldered with the development board,what other option I have to rectify it?And according to my schematic pin 13 with respect to the ground reads 0V and pin 14 wrt ground reads -10V. Is this reading correct? Please clarify..

Thankyou

- - - Updated - - -

Hi,

Please upload the correct max232 schematic and its connections with db9 if you have.


Thankyou
 

The connection is always TX of one device to RX on the next and so on.
The schematic attached is correct but it uses the other transmitter and receiver in the MAX232. the pin numbers are shown, all you have to do is swap T2 with T1 and R2 with R1.

Brian.

 

Hi,

Thankyou Betwixt for this information. I wonder how the kit manufacturers have messed up the important connections! Really shocking. Now I can't use this kit for my project. I shall take MAX232 IC and try out by crossconnectiong the RC6 to pin 11 and RC7 to pin 12. I will get back if any other doubts.

Thanks a lot
 

It happens sometimes and I think some of the cheap 'prototype' boards on the Internet are actually rejects because of incorrect design. I have one here with an LCD display on it that has the RS line connected to ground making it impossible to use the LCD at all!

Brian.
 

Hi,

Oh that is so wierd. I actually have two kits with the same schematic on both the boards!!Here in this case if I am not able to transmit receive to/from hyperterminal, atleast the loopback should work as the swapping of connections does'nt make a difference in loopback right? But my pin 13(R1IN) reads 0V wrt GND(pin 15). Would that be the reason for the loopback from TXREG to RCREG to not happen? I should justify my statement as I need approval to buy a different board so please let me know.Pin 14(T1OUT) reads 9.1V wrt GND(pin 15).Please let me know.

Thankyou
 

The logic level side inputs should read 0V or close to it, the logic side outputs should read either 0V or close to 5V. The RS232 side outputs should read either +10V or -10V although the 9.1V you measure is perfectly acceptable. RS232 inputs should read around 0V. These are without anything driving the IC, obviously if something drives a pin high it will have more voltage on it.

Brian.
 

Hi,

Thankyou Betwixt for this information. I wonder how the kit manufacturers have messed up the important connections! Really shocking. Now I can't use this kit for my project. I shall take MAX232 IC and try out by crossconnectiong the RC6 to pin 11 and RC7 to pin 12. I will get back if any other doubts.

Thanks a lot

Swapna, You must be using a cable to connect your PC's port and the DB9 connector of your Kit. Plesae check the cable. What is written on the cable? Is it a straight cable or is it a Cross over cable. I think the the kit manufacturers has supplied two types of cables for two kits. Check the documentation.
The point is - Where the cross over is implemented - in the cable or in the Board?
 

papunblg - in this case the board is wired with the PIC side of the MAX232 reversed. The PIC TX is wired to the output of the MAX232 and the RX to it's input. They should be the other way around, a TX pin always drives an RX pin. It seems to be a PCB layout mistake and there may also be an eror on the MAX232 to DB9 side as well. You are wise to alert us to the possibility of a cross-over cable though.

Brian.
 

Hi Papunblg,

Actually the kit manufacturers have just supplied the kit and the connectors along with the debugger and adapter. There are no cables supplied. So I have myself done the soldering of wires by taking two DB9 connectors. I connected the PIC side TX(pin 3) to the PC side RX(pin 2) and the PIC side RX(pin 2) to PC side TX(pin 3) and common GND(pin 5) of both DB9 connectors. This is how I have connected the cable.

Thankyou
 

Hi Betwixt,

I have another doubt with respect to the pin diagram of MAX232 IC. The data which comes in through the T1IN(pin 11) is connected internally to TOUT(pin14) or to R1IN(pin 13) of the IC?Please clarify.

Thankyou

- - - Updated - - -

Hi Betwixt,

I have another doubt with respect to the pin diagram of MAX232 IC. The data which comes in through the T1IN(pin 11) is connected internally to TOUT(pin14) or to R1IN(pin 13) of the IC?Please clarify.

Thankyou
 

The IC has two converter channels from Logic to RS232 and two converter channels from RS232 to logic levels, they work completely independent of each other.

Logic to RS232:
T1IN (pin 11) signal comes out on T1OUT (pin 14)
T2IN (pin 10) signal comes out on T2OUT (pin 7)

RS232 to Logic:
R1IN (pin 13) signal comes out on R1OUT (pin 12)
R2IN (pin 8) signal comes out on R2OUT (pin 9)

There is no link between 'R' and 'T' signals.

Brian.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top