Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 23:03 02 Aug 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : A serial mystery....

     Page 2 of 2    
Author Message
MicroBlocks

Guru

Joined: 12/05/2012
Location: Thailand
Posts: 2209
Posted: 06:31am 24 Jul 2018
Copy link to clipboard 
Print this post

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 Zealand
Posts: 9610
Posted: 06:51am 24 Jul 2018
Copy link to clipboard 
Print this post

@ 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: Thailand
Posts: 2209
Posted: 09:39am 24 Jul 2018
Copy link to clipboard 
Print this post

@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 States
Posts: 328
Posted: 05:31pm 24 Jul 2018
Copy link to clipboard 
Print this post

Grogster, I noticed the documentation says "Default baud rate is 115200bps" but you are opening the COM port at 9600. Edited by Justplayin 2018-07-26
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 Zealand
Posts: 9610
Posted: 12:20am 25 Jul 2018
Copy link to clipboard 
Print this post

@ 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: Australia
Posts: 446
Posted: 01:02am 25 Jul 2018
Copy link to clipboard 
Print this post

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 Zealand
Posts: 9610
Posted: 01:05am 25 Jul 2018
Copy link to clipboard 
Print this post

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 Zealand
Posts: 9610
Posted: 07:09am 25 Jul 2018
Copy link to clipboard 
Print this post

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.....



Edited by Grogster 2018-07-26
Smoke makes things work. When the smoke gets out, it stops!
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3292
Posted: 07:48am 25 Jul 2018
Copy link to clipboard 
Print this post

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 Zealand
Posts: 9610
Posted: 07:58am 25 Jul 2018
Copy link to clipboard 
Print this post

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: Australia
Posts: 195
Posted: 08:05am 25 Jul 2018
Copy link to clipboard 
Print this post

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.Edited by erbp 2018-07-26
 
Azure

Guru

Joined: 09/11/2017
Location: Australia
Posts: 446
Posted: 08:58am 25 Jul 2018
Copy link to clipboard 
Print this post

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 Zealand
Posts: 9610
Posted: 09:09am 25 Jul 2018
Copy link to clipboard 
Print this post

Grogster is happy.








Calling and receiving number censored for privacy. One message censored to comply with forum rules. Green messages are ones I have sent to the module, and white ones are ones I have sent from the module back to my phone.
Smoke makes things work. When the smoke gets out, it stops!
 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2442
Posted: 12:56pm 25 Jul 2018
Copy link to clipboard 
Print this post

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 :-)
Edited by robert.rozee 2018-07-26
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 4044
Posted: 05:24pm 27 Jul 2018
Copy link to clipboard 
Print this post

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 Zealand
Posts: 9610
Posted: 11:38pm 27 Jul 2018
Copy link to clipboard 
Print this post

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 Kingdom
Posts: 4044
Posted: 06:32am 28 Jul 2018
Copy link to clipboard 
Print this post

Ah. Thanks for that explanation.

(Naughty device!)

John
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9610
Posted: 08:33am 28 Jul 2018
Copy link to clipboard 
Print this post

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!
 
     Page 2 of 2    
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025