![]() |
Forum Index : Microcontroller and PC projects : A serial mystery....
![]() ![]() |
|||||
Author | Message | ||||
MicroBlocks![]() Guru ![]() Joined: 12/05/2012 Location: ThailandPosts: 2209 |
Why is the sequence "\r\r\n" after the AT command? I would expect "\r\n" or "\r\n\r\n" Microblocks. Build with logic. |
||||
Grogster![]() Admin Group ![]() Joined: 31/12/2012 Location: New ZealandPosts: 9610 |
@ Azure: Saleae Logic I am using the 8-port one. There are clones on eBay and AliExpress for much cheaper, but I bought the authentic one. @ MB: My theory is that this is the echo. I technically sent "AT<cr><lf>" from the MM(no ; at the end to suppress cr/lf), so that is echoed first, then the reply from the module. Smoke makes things work. When the smoke gets out, it stops! |
||||
MicroBlocks![]() Guru ![]() Joined: 12/05/2012 Location: ThailandPosts: 2209 |
@Grog, If you send a "AT<cr><lf>" then that is what should have been echoed back. But it didn't. How it looks like to me is that the MM sends "AT<cr>" and the reply from the module was "<cr><lf>OK<cr><lf>" Did not expect that as i thought the MM was outputting a "<lf>" also. It is either that or a complete character was lost. Which i doubt because you would have seen that on the analyzer. Microblocks. Build with logic. |
||||
Justplayin![]() Guru ![]() Joined: 31/01/2014 Location: United StatesPosts: 328 |
Grogster, I noticed the documentation says "Default baud rate is 115200bps" but you are opening the COM port at 9600. I am not a Mad Scientist... It makes me happy inventing new ways to take over the world!! |
||||
Grogster![]() Admin Group ![]() Joined: 31/12/2012 Location: New ZealandPosts: 9610 |
@ MB - Good point. I had had a few glasses of wine by that stage last night. I therefore don't have an explanation for the reply from the module, only to say that it DOES reply, but at the moment, only the logic analyser can see it - nothing else can. If I put the logic analyser AND the MM on TXD from the module, and run the same test, all I get back is zero bytes, and the logic analyser shows that TXD never ever even once deviated from 3v3. So, that is why there is no data, but WHY this is happening has me stumped. @ Justplayin - Good point, but I have reset the baud-rate using the command AT+IPREX=9600 while I had it talking via the MAX3232 module and COM1 on the PC. I was concerned that the 115k2 baudrate was behind the problem somehow during my testing, so I lowered it to 9600. This has proven not to be the case at all, but I left it at 9600 once I had set it. Smoke makes things work. When the smoke gets out, it stops! |
||||
Azure![]() Guru ![]() Joined: 09/11/2017 Location: AustraliaPosts: 446 |
Any luck with giving the ChangePin function a try to turn off the pullup on MM Rxd pin? |
||||
Grogster![]() Admin Group ![]() Joined: 31/12/2012 Location: New ZealandPosts: 9610 |
Thank you for your continued interest. ![]() I have not had a chance to try that yet, but I most certainly will. I have to prepare for this afternoon's jobs, so it won't be till tonight my time. I am eager to try that though, and see what happens. Smoke makes things work. When the smoke gets out, it stops! |
||||
Grogster![]() Admin Group ![]() Joined: 31/12/2012 Location: New ZealandPosts: 9610 |
Well, bugger me...... ![]() ...and my test code: ![]() This module seems to be VERY touchy to any kind of external pull-up. Even the internally supplied one by the MM upsets it! Having disabled the internal pull-up, everything is working! It even forwarded a text message I sent earlier in the day. (cell-phone number scrambled for privacy) Now, where did I put that good quality Scotch..... EDIT: The MM internal pull-up is not a resistive pull-up, correct? I seem to recall reading that this weak pull-up is actually formed out of a FET junction or something. If Geoff or Peter reads this, perhaps they can just clarify that at a technical level for me. EDIT: Oh, I am so happy..... ![]() ![]() Smoke makes things work. When the smoke gets out, it stops! |
||||
Geoffg![]() Guru ![]() Joined: 06/06/2011 Location: AustraliaPosts: 3292 |
I think that you are right about "weak pull-up is actually formed out of a FET junction or something". Microchip don't provide a lot of detail besides saying that it is a constant current source of about 50uA. Geoff Geoff Graham - http://geoffg.net |
||||
Grogster![]() Admin Group ![]() Joined: 31/12/2012 Location: New ZealandPosts: 9610 |
Thank the God of your choice, that you wrote the ChangePin Cfunction. Without it, I would still be stuck! ![]() Smoke makes things work. When the smoke gets out, it stops! |
||||
erbp Senior Member ![]() Joined: 03/05/2016 Location: AustraliaPosts: 195 |
Maybe its just that this chip checks the voltage present on its TXD line when it starts up, before it takes control of the line. If it detects any voltage above some small threshold it simply assumes some other device is controlling the line and it doesn't even attempt to output any TX data stream. An earlier post did mention that the specs said that pull-ups should not be present. Kind of weird behaviour but it matches the observed conditions. Cheers, Phil. Edit: Actually that is probably not correct as it would start before the COM port is opened and at that time the MM Rx pin would still be not configured, so the pull-up wouldn't be in effect. Phil. |
||||
Azure![]() Guru ![]() Joined: 09/11/2017 Location: AustraliaPosts: 446 |
Congratulations, I'm glad you got it sorted. I agree with the sensitive part. It is obviously enough to upset it forming some sort of resistive divider. It is down to the level shifter IC. You are correct re the PIC, it is done using semiconductor technology. Resistors are too hard to fab in silicon compared to a weak semiconductor low current source. |
||||
Grogster![]() Admin Group ![]() Joined: 31/12/2012 Location: New ZealandPosts: 9610 |
Grogster is happy. ![]() ![]() ![]() Calling and receiving number censored for privacy. One message censored to comply with forum rules. ![]() Smoke makes things work. When the smoke gets out, it stops! |
||||
robert.rozee Guru ![]() Joined: 31/12/2012 Location: New ZealandPosts: 2442 |
you might like to try an external pullup resistor (of 47k) just to see what effect it has. and then an external pulldown. it is still possible that your module may be faulty, i've struck solder bridges and open circuits on various chinese modules in the past. cheers, rob :-) |
||||
JohnS Guru ![]() Joined: 18/11/2011 Location: United KingdomPosts: 4044 |
Would it not have to be able to cope with a big (e.g. 1M) pullup? Otherwise would there not be a risk of a floating level? John |
||||
Grogster![]() Admin Group ![]() Joined: 31/12/2012 Location: New ZealandPosts: 9610 |
That was one of my first thoughts too, John, but reading through the 1v8-3v3 level-shifter IC they are using on the module(see page 2 for part number and PDF), when there is no data, this chip pulls the module TXD pin high to 3v3. That means that so long as you leave it connected, this chip will pull the MM COM1 RXD pin idle-high, so it is not floating, and does not misbehave. I have left the MM and the module running all day on test, and when I check that night, there is nothing in the COM1 buffer, as you would expect. If you disconnect the module, then the MM pin could technically float and you might end up with white-noise garbage filling up the buffer. Smoke makes things work. When the smoke gets out, it stops! |
||||
JohnS Guru ![]() Joined: 18/11/2011 Location: United KingdomPosts: 4044 |
Ah. Thanks for that explanation. (Naughty device!) John |
||||
Grogster![]() Admin Group ![]() Joined: 31/12/2012 Location: New ZealandPosts: 9610 |
Yes, it is. ![]() I think it is still a RELATIVELY high-impedance device, as the first couple of pages were all about trying to work out why the hell it was not responding. ![]() It still won't talk to a CP2101 USB-serial adaptor, but I expect that this module PROBABLY has on-board pull-ups in the area of 4k7 to 10k. Smoke makes things work. When the smoke gets out, it stops! |
||||
![]() ![]() |
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |