MAX232 not working

Thread Starter

T.A

Joined Dec 22, 2016
40
Thanks Spinnaker. i would try using the scope.
For the source code, i do not think Microchip has peripheral library for the 16F series, but i know it is available for the 18F series. i am using PIC 16F877A.
Do you have any source code you can guarantee that it is working? if you do not mind, kindly share with me.
 

spinnaker

Joined Oct 29, 2009
7,830
Thanks Spinnaker. i would try using the scope.
For the source code, i do not think Microchip has peripheral library for the 16F series, but i know it is available for the 18F series. i am using PIC 16F877A.
Do you have any source code you can guarantee that it is working? if you do not mind, kindly share with me.

I would take a look at the plib anyway. You might be able to get some ideas.

If I get some time, I will take a closer look at your code and compare to what I am doing.

I did just check for you and that chip is not supported by MCC. :)

Whatever you do. Do two things. Look at your Pic to see if it is sending out anything. What I do is to create a loop that does nothing but send data. I get that working first then move on to the Pic handling inputs.

Also do away with those interrupts for now.
 

cmartinez

Joined Jan 17, 2007
8,760
Thanks guys for your comment.
i will get 0.1uf cap at the electronics store. should it be a tantalum or electrolytic cap ?
i have attached the source code and the enlarged image of the schematics.
is there anything wrong with the source code or schematics?

View attachment 117458
You don't need tantalum for that, way too fancy for what the chip needs. An ordinary 0.1uf ceramic capacitor should do the trick. In this case, they're better than electrolytic, since they're not polarized.

Here's something you may want to double check: Have you checked in your original circuit that you installed the capacitors in the correct orientation? That is, are their positive and negative pins in the right direction?
 

spinnaker

Joined Oct 29, 2009
7,830
You don't need tantalum for that, way too fancy for what the chip needs. An ordinary 0.1uf ceramic capacitor should do the trick. In this case, they're better than electrolytic, since they're not polarized.
If I am reading the thread right, the TS is using the MAX232 which requires 1mfd. Is TS going to be to get a ordinary 1mkfd cap?
 

markdem

Joined Jul 31, 2013
113
Did you try the local loopback like I suggested? This will prove you have the Rx and tx pins from the pc the right way around and that the max232 is working.
Right now you have multiple points of potential error. You need to eliminate some of them.
 

cmartinez

Joined Jan 17, 2007
8,760
I think he needs 1mfd or maybe it is me that is mixed up on that one. Lots of values being thrown around in this thread. :)
According to the datasheet, the ordinary MAX232 requires 1 micro-farad capacitots. Please excuse me, but when I saw you mention "1mfd", I couldn't help but think of milli-farads.

I frankly think it's a mistake of Maxim's, since the MAX232E datasheet does show "1mF" in figure 10 (see attachments). Although in the same page it's clarified they're referring to 1uF.

Also, in the same page it's mentioned that

"MAX232E requires 1-µF capacitors, although capacitors up to 10 µF can be used without harm"

To me, this means that usig a cap value that is too high will result in a malfunction.

That might've been the case when I tried to use 10uF caps in a chip that was designed for 0.1uF caps.
 

Attachments

bwack

Joined Nov 15, 2011
113
Once I had gone east and west to solve the problem which happened to be a toasted serial port on the pc. Scoping is a good idea.
Anyway, What compiler are you using ? XC8 ? Can you post the code ?
 

Thread Starter

T.A

Joined Dec 22, 2016
40
Compliment of the season guys.
Thanks for all you effort and comments. i do appreciate.
I have gotten the solution to the problem.
The problem was with the serial to USB converter cable. i changed it by instinct , and the project started working properly. both the 10uf and 1uf cap are working properly.

But what surprises me is that the computer never gave any error about the cable. is there any way of testing if a serial to USB converter cable is working properly ?
 

cmartinez

Joined Jan 17, 2007
8,760
Compliment of the season guys.
Thanks for all you effort and comments. i do appreciate.
I have gotten the solution to the problem.
The problem was with the serial to USB converter cable. i changed it by instinct , and the project started working properly. both the 10uf and 1uf cap are working properly.

But what surprises me is that the computer never gave any error about the cable. is there any way of testing if a serial to USB converter cable is working properly ?
Yes, you short its Tx output to its Rx input. Then send a character. If it's working properly, that character should be sent back to the computer.
 

Thread Starter

T.A

Joined Dec 22, 2016
40
Yes, you short its Tx output to its Rx input. Then send a character. If it's working properly, that character should be sent back to the computer.
Thanks. But according to what you have just said, if the character is not sent back, the problem might not necessarily be with the cable.it might be something else.
What am asking is, is there a crude way of testing not necessarily with the computer, if the cable is good ???
 

cmartinez

Joined Jan 17, 2007
8,760
it might be something else.
Sure it might be something else, like the usb port itself.
But you do need a computer to test it anyway. After all, the cable has its own MCU controller inside, and you need to communicate with it somehow to do the tests. You could test the wiring for continuity, but that's as far as you'd get with an MM.

My only other recommendation would be that you do the same test using a different computer, and maybe a different OS
 

Thread Starter

T.A

Joined Dec 22, 2016
40
Hello guys. I have a question.
I am trying to interface my microcontroller to a GSM modem.
The GSM module am using is SIMCOM908.
do I still need the max232 in between the microcontroller and the GSM module ?
 

cmartinez

Joined Jan 17, 2007
8,760
Hello guys. I have a question.
I am trying to interface my microcontroller to a GSM modem.
The GSM module am using is SIMCOM908.
do I still need the max232 in between the microcontroller and the GSM module ?
Check page 30 of the datasheet I've attached. It shows that one needs to convert the module's serial signal to RS232 if you want to connect it to a PC through its RS232 port. Therefore, the module's UART output works at low voltage level, and it tells me that you do not need an RS232 converter to interface it directly to an MCU as long as both the MCU and the module are working at the same voltage, which normally is 5V.
 

Attachments

Top