For the hardware guys - Michael Stegen, Brian, William - anyone :-) On the v1 board, we have: The MAX942 chip is used for the SIMCOM TX -> PIC RX line, to convert the 3.3v SIMCOM async communication to 5v TTL for the PIC. My understanding of this is that the SIMCOM chip, while expecting 3.3v can accept 5v (TX from PIC, RX to SIMCOM) - and a diode is used on the circuit for this. But on the line from the SIMCOM to the PIC (TX from SIMCOM, RX to PIC), the SIMCOM only gives out 3.3v, but the PIC requires 5v TTL levels. One half of the MAX942 is used for that, and the other half is unused. I've seen some reference designs for such conversion, but all required both 5v and 3.3v power to handle it. In the original design (two separate boards), we had no 3.3v power on the PIC board, so could only do it the MAX942 way. Now, in the new v2 design, we have both 5v and 3.3v power lines on the same board, so perhaps we can do it a simpler way. The MAX942 chip is (relatively) expensive. The China guys are asking what we want to do with this, and suggesting using resistors to handle the 3.3v->5v conversion now. I guess some sort of voltage divider. Has anyone done anything similar? Regards, Mark.
Same problem I had with the BeagleBone. All of the *bone's pins are 3.3v. I based a couple of level shifters off of a Sparkfun design<http://www.sparkfun.com/products/8745>. Basically it is a transistor for the TX line and a resistor for the RX line. The elegance of this design is it is 4 resistors and one transistor. William On Wed, Jul 4, 2012 at 7:27 PM, Mark Webb-Johnson <mark@webb-johnson.net>wrote:
For the hardware guys - Michael Stegen, Brian, William - anyone :-)
On the v1 board, we have:
The MAX942 chip is used for the SIMCOM TX -> PIC RX line, to convert the 3.3v SIMCOM async communication to 5v TTL for the PIC.
My understanding of this is that the SIMCOM chip, while expecting 3.3v can accept 5v (TX from PIC, RX to SIMCOM) - and a diode is used on the circuit for this. But on the line from the SIMCOM to the PIC (TX from SIMCOM, RX to PIC), the SIMCOM only gives out 3.3v, but the PIC requires 5v TTL levels. One half of the MAX942 is used for that, and the other half is unused.
I've seen some reference designs for such conversion, but all required both 5v and 3.3v power to handle it. In the original design (two separate boards), we had no 3.3v power on the PIC board, so could only do it the MAX942 way.
Now, in the new v2 design, we have both 5v and 3.3v power lines on the same board, so perhaps we can do it a simpler way. The MAX942 chip is (relatively) expensive.
The China guys are asking what we want to do with this, and suggesting using resistors to handle the 3.3v->5v conversion now. I guess some sort of voltage divider.
Has anyone done anything similar?
Regards, Mark.
_______________________________________________ OvmsDev mailing list OvmsDev@lists.teslaclub.hk http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
William, Thanks for the reference. I'll pass it along. BS138 is US$0.14 in quantities of 100, vs US$2.6 for MAX942. Having both 3.3v and 5v available does make things simpler. Regards, Mark. On 5 Jul, 2012, at 8:47 AM, William Petefish wrote:
Same problem I had with the BeagleBone. All of the *bone's pins are 3.3v. I based a couple of level shifters off of a Sparkfun design. Basically it is a transistor for the TX line and a resistor for the RX line. The elegance of this design is it is 4 resistors and one transistor.
William
On Wed, Jul 4, 2012 at 7:27 PM, Mark Webb-Johnson <mark@webb-johnson.net> wrote: For the hardware guys - Michael Stegen, Brian, William - anyone :-)
On the v1 board, we have:
The MAX942 chip is used for the SIMCOM TX -> PIC RX line, to convert the 3.3v SIMCOM async communication to 5v TTL for the PIC.
My understanding of this is that the SIMCOM chip, while expecting 3.3v can accept 5v (TX from PIC, RX to SIMCOM) - and a diode is used on the circuit for this. But on the line from the SIMCOM to the PIC (TX from SIMCOM, RX to PIC), the SIMCOM only gives out 3.3v, but the PIC requires 5v TTL levels. One half of the MAX942 is used for that, and the other half is unused.
I've seen some reference designs for such conversion, but all required both 5v and 3.3v power to handle it. In the original design (two separate boards), we had no 3.3v power on the PIC board, so could only do it the MAX942 way.
Now, in the new v2 design, we have both 5v and 3.3v power lines on the same board, so perhaps we can do it a simpler way. The MAX942 chip is (relatively) expensive.
The China guys are asking what we want to do with this, and suggesting using resistors to handle the 3.3v->5v conversion now. I guess some sort of voltage divider.
Has anyone done anything similar?
Regards, Mark.
_______________________________________________ OvmsDev mailing list OvmsDev@lists.teslaclub.hk http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
_______________________________________________ OvmsDev mailing list OvmsDev@lists.teslaclub.hk http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
Op 5-7-2012 2:27, Mark Webb-Johnson schreef:
For the hardware guys - Michael Stegen, Brian, William - anyone :-)
The MAX942 chip is used for the SIMCOM TX -> PIC RX line, to convert the 3.3v SIMCOM async communication to 5v TTL for the PIC.
My understanding of this is that the SIMCOM chip, while expecting 3.3v can accept 5v (TX from PIC, RX to SIMCOM) - and a diode is used on the circuit for this.
Actually i used the internal pullup of the UART in the GSM modem (in my original design) as a logic "1", the PIC will pull the line low when it wants to send a logic "0". The diode also blocks any 5V from going into the modem.
But on the line from the SIMCOM to the PIC (TX from SIMCOM, RX to PIC), the SIMCOM only gives out 3.3v, but the PIC requires 5v TTL levels. One half of the MAX942 is used for that, and the other half is unused.
You can also power the PIC from 3.3v, i don't think that wil cause any issues on the CAN transceiver. The Can transceiver sees a logic "1" at 2 volts, so a level converter between these two chips is not needed. As the X-tal operates at 20Mhz, it should work. According to the datasheet the max clock @ 3.3v is 25Mhz Another way to make it a bit cheaper is to use a 18F26K80, an improved version of the 18F2680. But that will likely require some changes to the code, as it's not a direct replacement. http://www.microchip.com/wwwproducts/Devices.aspx?dDocName=en550199 It also has two UARTS, and comperators, which you can use instead of the MAX942. -Michael
Ok i have to correct myself here.. The 18*F*2680 will not work on 3.3 volt. You will have to use the 18*LF*2680 for that. -Michael
For the hardware guys - Michael Stegen, Brian, William - anyone :-)
The MAX942 chip is used for the SIMCOM TX -> PIC RX line, to convert the 3.3v SIMCOM async communication to 5v TTL for the PIC.
My understanding of this is that the SIMCOM chip, while expecting 3.3v can accept 5v (TX from PIC, RX to SIMCOM) - and a diode is used on the circuit for this.
Actually i used the internal pullup of the UART in the GSM modem (in my original design) as a logic "1", the PIC will pull the line low when it wants to send a logic "0". The diode also blocks any 5V from going into the modem.
But on the line from the SIMCOM to the PIC (TX from SIMCOM, RX to PIC), the SIMCOM only gives out 3.3v, but the PIC requires 5v TTL levels. One half of the MAX942 is used for that, and the other half is unused.
You can also power the PIC from 3.3v, i don't think that wil cause any issues on the CAN transceiver. The Can transceiver sees a logic "1" at 2 volts, so a level converter between these two chips is not needed. As the X-tal operates at 20Mhz, it should work. According to the datasheet the max clock @ 3.3v is 25Mhz
Another way to make it a bit cheaper is to use a 18F26K80, an improved version of the 18F2680. But that will likely require some changes to the code, as it's not a direct replacement. http://www.microchip.com/wwwproducts/Devices.aspx?dDocName=en550199 It also has two UARTS, and comperators, which you can use instead of the MAX942.
-Michael _______________________________________________ OvmsDev mailing list OvmsDev@lists.teslaclub.hk http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
Michael, Seems a bit risky to change at this late stage, and we still need the +5V for the CAN transceiver. I do like the sound of the 18F26K80 though - the dual UARTS would be helpful for something I'm working on. What do you think of William's suggestion of that sparkfun design? Seems quite elegant, and simpler than the MAX chip now we have access to 3.3v supply. Regards, Mark. On 5 Jul, 2012, at 9:38 PM, Michael Stegen wrote:
Ok i have to correct myself here..
The 18F2680 will not work on 3.3 volt. You will have to use the 18LF2680 for that.
-Michael
For the hardware guys - Michael Stegen, Brian, William - anyone :-)
The MAX942 chip is used for the SIMCOM TX -> PIC RX line, to convert the 3.3v SIMCOM async communication to 5v TTL for the PIC.
My understanding of this is that the SIMCOM chip, while expecting 3.3v can accept 5v (TX from PIC, RX to SIMCOM) - and a diode is used on the circuit for this.
Actually i used the internal pullup of the UART in the GSM modem (in my original design) as a logic "1", the PIC will pull the line low when it wants to send a logic "0". The diode also blocks any 5V from going into the modem.
But on the line from the SIMCOM to the PIC (TX from SIMCOM, RX to PIC), the SIMCOM only gives out 3.3v, but the PIC requires 5v TTL levels. One half of the MAX942 is used for that, and the other half is unused.
You can also power the PIC from 3.3v, i don't think that wil cause any issues on the CAN transceiver. The Can transceiver sees a logic "1" at 2 volts, so a level converter between these two chips is not needed. As the X-tal operates at 20Mhz, it should work. According to the datasheet the max clock @ 3.3v is 25Mhz
Another way to make it a bit cheaper is to use a 18F26K80, an improved version of the 18F2680. But that will likely require some changes to the code, as it's not a direct replacement. http://www.microchip.com/wwwproducts/Devices.aspx?dDocName=en550199 It also has two UARTS, and comperators, which you can use instead of the MAX942.
-Michael _______________________________________________ OvmsDev mailing list OvmsDev@lists.teslaclub.hk http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
_______________________________________________ OvmsDev mailing list OvmsDev@lists.teslaclub.hk http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
Yes, William's sparkfun design looks good, and is a lot cheaper then the MAX chip. If you just want a replacement for the MAX942, it's probably the best choice. -Michael Op 5-7-2012 15:47, Mark Webb-Johnson schreef:
Michael,
Seems a bit risky to change at this late stage, and we still need the +5V for the CAN transceiver. I do like the sound of the 18F26K80 though - the dual UARTS would be helpful for something I'm working on.
What do you think of William's suggestion of that sparkfun design? Seems quite elegant, and simpler than the MAX chip now we have access to 3.3v supply.
Regards, Mark.
On 5 Jul, 2012, at 9:38 PM, Michael Stegen wrote:
Ok i have to correct myself here..
The 18*F*2680 will not work on 3.3 volt. You will have to use the 18*LF*2680 for that.
-Michael
For the hardware guys - Michael Stegen, Brian, William - anyone :-)
The MAX942 chip is used for the SIMCOM TX -> PIC RX line, to convert the 3.3v SIMCOM async communication to 5v TTL for the PIC.
My understanding of this is that the SIMCOM chip, while expecting 3.3v can accept 5v (TX from PIC, RX to SIMCOM) - and a diode is used on the circuit for this.
Actually i used the internal pullup of the UART in the GSM modem (in my original design) as a logic "1", the PIC will pull the line low when it wants to send a logic "0". The diode also blocks any 5V from going into the modem.
But on the line from the SIMCOM to the PIC (TX from SIMCOM, RX to PIC), the SIMCOM only gives out 3.3v, but the PIC requires 5v TTL levels. One half of the MAX942 is used for that, and the other half is unused.
You can also power the PIC from 3.3v, i don't think that wil cause any issues on the CAN transceiver. The Can transceiver sees a logic "1" at 2 volts, so a level converter between these two chips is not needed. As the X-tal operates at 20Mhz, it should work. According to the datasheet the max clock @ 3.3v is 25Mhz
Another way to make it a bit cheaper is to use a 18F26K80, an improved version of the 18F2680. But that will likely require some changes to the code, as it's not a direct replacement. http://www.microchip.com/wwwproducts/Devices.aspx?dDocName=en550199 It also has two UARTS, and comperators, which you can use instead of the MAX942.
-Michael _______________________________________________ OvmsDev mailing list OvmsDev@lists.teslaclub.hk http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
_______________________________________________ OvmsDev mailing list OvmsDev@lists.teslaclub.hk <mailto:OvmsDev@lists.teslaclub.hk> http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
_______________________________________________ OvmsDev mailing list OvmsDev@lists.teslaclub.hk http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
On Jul 4, 2012, at 17:27, Mark Webb-Johnson wrote:
The MAX942 chip is used for the SIMCOM TX -> PIC RX line, to convert the 3.3v SIMCOM async communication to 5v TTL for the PIC.
My understanding of this is that the SIMCOM chip, while expecting 3.3v can accept 5v (TX from PIC, RX to SIMCOM) - and a diode is used on the circuit for this. But on the line from the SIMCOM to the PIC (TX from SIMCOM, RX to PIC), the SIMCOM only gives out 3.3v, but the PIC requires 5v TTL levels. One half of the MAX942 is used for that, and the other half is unused.
Has anyone done anything similar?
Yes, this is very common. Many newer chips are 3.3 V while many older chips are 5 V, and sometimes it is difficult to design with all chips the same. The thing to do is start with the data sheets. A) What is the minimum output voltage of the SIMCOM TX pin? B) What is the minimum input voltage for the PIC RX pin to detect a logic one? If A is greater than B, then you don't have to do anything at all. I have many designs where this is the case. Looking at the data sheet for the PIC18F2580, on page 433, it shows that anything over 2.0 V is considered a one, so long as the PIC is getting at least 4.5 V of power. If you're running the board at 5.0 V then you're set. Just connect the SIMCOM TX directly to the PIC RX, with no resistor, diode, or anything that costs money. The only exception would be if the SIMCOM dips below 2.0 V output under certain conditions. I'm sure you still need the diode to protect the SIMCOM RX from the 5 V PIC TX. Brian
Brian, Interesting. That was originally used because of the old DX modem, but the thresholds on the SIM908 / SIM900 do seem more generous. The SIM908 is powered at 3.3V, and the PIC18F2685 at 5.0V. From the SIM908 manual: From the PIC18F2685 manual: That would seem to say that the SIM908 will use 2.7V as it's minimum output voltage, and the PIC18F2685 will accept anything above 2.0V. So, SIM908 TX -> PIC RX should be ok. For the other way, the PIC18F2685 will transmit at VDD-0.7 - 4.3V, and the SIM908 will accept anything above 2.4V. From that description, the entire MAX942 circuit is not required. The RX and TX pins of the SIM908 and PIC18F2685 can be directly connected to each other. What do you think? Perhaps it is time to find my old breadboard and try it... Regards, Mark. On 6 Jul, 2012, at 5:28 PM, HONDA S-2000 wrote:
On Jul 4, 2012, at 17:27, Mark Webb-Johnson wrote:
The MAX942 chip is used for the SIMCOM TX -> PIC RX line, to convert the 3.3v SIMCOM async communication to 5v TTL for the PIC.
My understanding of this is that the SIMCOM chip, while expecting 3.3v can accept 5v (TX from PIC, RX to SIMCOM) - and a diode is used on the circuit for this. But on the line from the SIMCOM to the PIC (TX from SIMCOM, RX to PIC), the SIMCOM only gives out 3.3v, but the PIC requires 5v TTL levels. One half of the MAX942 is used for that, and the other half is unused.
Has anyone done anything similar?
Yes, this is very common. Many newer chips are 3.3 V while many older chips are 5 V, and sometimes it is difficult to design with all chips the same.
The thing to do is start with the data sheets.
A) What is the minimum output voltage of the SIMCOM TX pin? B) What is the minimum input voltage for the PIC RX pin to detect a logic one?
If A is greater than B, then you don't have to do anything at all. I have many designs where this is the case.
Looking at the data sheet for the PIC18F2580, on page 433, it shows that anything over 2.0 V is considered a one, so long as the PIC is getting at least 4.5 V of power. If you're running the board at 5.0 V then you're set. Just connect the SIMCOM TX directly to the PIC RX, with no resistor, diode, or anything that costs money.
The only exception would be if the SIMCOM dips below 2.0 V output under certain conditions.
I'm sure you still need the diode to protect the SIMCOM RX from the 5 V PIC TX.
Brian
_______________________________________________ OvmsDev mailing list OvmsDev@lists.teslaclub.hk http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
On Jul 6, 2012, at 06:04, Mark Webb-Johnson wrote:
The SIM908 is powered at 3.3V, and the PIC18F2685 at 5.0V.
That would seem to say that the SIM908 will use 2.7V as it's minimum output voltage, and the PIC18F2685 will accept anything above 2.0V. So, SIM908 TX -> PIC RX should be ok.
For the other way, the PIC18F2685 will transmit at VDD-0.7 - 4.3V, and the SIM908 will accept anything above 2.4V.
From that description, the entire MAX942 circuit is not required. The RX and TX pins of the SIM908 and PIC18F2685 can be directly connected to each other.
What do you think? Perhaps it is time to find my old breadboard and try it...
I think it should work perfectly fine from SIM908 to PIC with just a trace. However, the SIM908 probably has an absolute maximum voltage specification that would not allow anything above 3.3 V on any pin. Thus, the other way, from PIC to SIM908, would not work with just a simple trace. Look around your data sheet for that limit. The existing diode (not shown in your schematic, but mentioned in email), is surely still necessary to protect the SIM908 from too much voltage. If there is a resistor in there as well as the diode, then that's probably necessary as well, but I can't remember what's typical. If you have the schematic for the other board, drop me a link and I'll take a look. In general, a device cannot work when one of its pins has a higher voltage than its own power input pin. If you connect a higher voltage, sometimes current will flow backwards through the chip, out the power pin, and raise your 3.3 V supply to 4 V or more. This will cause your regulator to heat up and possibly create other symptoms. It can be especially bad if other chips are not rated for 4 V power. I had a board where an unused chip was exposed to improper voltages, and it caused problems for quite a while. I never thought to check that chip. It was only when I removed the chip and noticed that all the random problems went away that I realized one of its pins was seeing a voltage higher than the supply. Had I checked the 3.3 V supply rail before, I would have seen that it sometimes went above 4 V, and that would have been a clue, but I didn't think of that until I had practically solved the problem. Brian
Danger Will Robinson! I have done exactly what is being described before. My advice, don't do it. For reliable operation the 3.3v parts need to be isolated from the 5v parts. You run a very real risk of burning out the circuit if you power a 3.3v device from 5v or even attempt comms without a level translator. (found this out the hard way with a rather expensive PCB.) At the very least you'll shorten the life on the GSM unit by running over voltage. William On Fri, Jul 6, 2012 at 1:39 PM, HONDA S-2000 <s2000@sounds.wa.com> wrote:
On Jul 6, 2012, at 06:04, Mark Webb-Johnson wrote:
The SIM908 is powered at 3.3V, and the PIC18F2685 at 5.0V.
That would seem to say that the SIM908 will use 2.7V as it's minimum output voltage, and the PIC18F2685 will accept anything above 2.0V. So, SIM908 TX -> PIC RX should be ok.
For the other way, the PIC18F2685 will transmit at VDD-0.7 - 4.3V, and the SIM908 will accept anything above 2.4V.
From that description, the entire MAX942 circuit is not required. The RX and TX pins of the SIM908 and PIC18F2685 can be directly connected to each other.
What do you think? Perhaps it is time to find my old breadboard and try it...
I think it should work perfectly fine from SIM908 to PIC with just a trace.
However, the SIM908 probably has an absolute maximum voltage specification that would not allow anything above 3.3 V on any pin. Thus, the other way, from PIC to SIM908, would not work with just a simple trace. Look around your data sheet for that limit. The existing diode (not shown in your schematic, but mentioned in email), is surely still necessary to protect the SIM908 from too much voltage. If there is a resistor in there as well as the diode, then that's probably necessary as well, but I can't remember what's typical. If you have the schematic for the other board, drop me a link and I'll take a look.
In general, a device cannot work when one of its pins has a higher voltage than its own power input pin. If you connect a higher voltage, sometimes current will flow backwards through the chip, out the power pin, and raise your 3.3 V supply to 4 V or more. This will cause your regulator to heat up and possibly create other symptoms. It can be especially bad if other chips are not rated for 4 V power.
I had a board where an unused chip was exposed to improper voltages, and it caused problems for quite a while. I never thought to check that chip. It was only when I removed the chip and noticed that all the random problems went away that I realized one of its pins was seeing a voltage higher than the supply. Had I checked the 3.3 V supply rail before, I would have seen that it sometimes went above 4 V, and that would have been a clue, but I didn't think of that until I had practically solved the problem.
Brian
______________________________**_________________ OvmsDev mailing list OvmsDev@lists.teslaclub.hk http://lists.teslaclub.hk/**mailman/listinfo/ovmsdev<http://lists.teslaclub.hk/mailman/listinfo/ovmsdev>
I think the BSS138 and voltage divider circuit is safest. It is cheap, simple, and gets everything at the correct voltages. I've asked the China guys to go with that. Regards, Mark On 7 Jul, 2012, at 7:09 AM, William Petefish <william.petefish@gmail.com> wrote:
Danger Will Robinson!
I have done exactly what is being described before. My advice, don't do it. For reliable operation the 3.3v parts need to be isolated from the 5v parts. You run a very real risk of burning out the circuit if you power a 3.3v device from 5v or even attempt comms without a level translator. (found this out the hard way with a rather expensive PCB.) At the very least you'll shorten the life on the GSM unit by running over voltage.
William
On Fri, Jul 6, 2012 at 1:39 PM, HONDA S-2000 <s2000@sounds.wa.com> wrote:
On Jul 6, 2012, at 06:04, Mark Webb-Johnson wrote:
The SIM908 is powered at 3.3V, and the PIC18F2685 at 5.0V.
That would seem to say that the SIM908 will use 2.7V as it's minimum output voltage, and the PIC18F2685 will accept anything above 2.0V. So, SIM908 TX -> PIC RX should be ok.
For the other way, the PIC18F2685 will transmit at VDD-0.7 - 4.3V, and the SIM908 will accept anything above 2.4V.
From that description, the entire MAX942 circuit is not required. The RX and TX pins of the SIM908 and PIC18F2685 can be directly connected to each other.
What do you think? Perhaps it is time to find my old breadboard and try it...
I think it should work perfectly fine from SIM908 to PIC with just a trace.
However, the SIM908 probably has an absolute maximum voltage specification that would not allow anything above 3.3 V on any pin. Thus, the other way, from PIC to SIM908, would not work with just a simple trace. Look around your data sheet for that limit. The existing diode (not shown in your schematic, but mentioned in email), is surely still necessary to protect the SIM908 from too much voltage. If there is a resistor in there as well as the diode, then that's probably necessary as well, but I can't remember what's typical. If you have the schematic for the other board, drop me a link and I'll take a look.
In general, a device cannot work when one of its pins has a higher voltage than its own power input pin. If you connect a higher voltage, sometimes current will flow backwards through the chip, out the power pin, and raise your 3.3 V supply to 4 V or more. This will cause your regulator to heat up and possibly create other symptoms. It can be especially bad if other chips are not rated for 4 V power.
I had a board where an unused chip was exposed to improper voltages, and it caused problems for quite a while. I never thought to check that chip. It was only when I removed the chip and noticed that all the random problems went away that I realized one of its pins was seeing a voltage higher than the supply. Had I checked the 3.3 V supply rail before, I would have seen that it sometimes went above 4 V, and that would have been a clue, but I didn't think of that until I had practically solved the problem.
Brian
_______________________________________________ OvmsDev mailing list OvmsDev@lists.teslaclub.hk http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
_______________________________________________ OvmsDev mailing list OvmsDev@lists.teslaclub.hk http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
participants (4)
-
HONDA S-2000 -
Mark Webb-Johnson -
Michael Stegen -
William Petefish