Should serial lines between IC's be pulled high or low?

BrendanP

Senior Member
I'm seeing a intermittent problem/fault with serial reception of sms's from a GSM module. On some occassions the sms come through clear. Other times its corrupted with random characters of the type you see when you serial out to a LCD with the wrong baud speed/mode.

At the monent the serial line between the gsm module and the picaxe is floating, tied neither high nor low. Could this be the cause of the problem?

I am serialing from the module at T2400_8.
 

hippy

Ex-Staff (retired)
The line's probably not floating per se and it's not usually necessary to pull the line high or low.

It could be more a case of not being ready and able to receive the data fast enough. If the PICAXE starts reading a character after the module has started to send it the result will be corrupt, similar to baud rate problems but a different issue.

How fast the PICAXE responds and is capable of receiving sequential back-to-back data depends on how fast you are running your code, what the code does, particularly whether using SERIN or HSERIN.
 

BrendanP

Senior Member
Thanks Hippy, Ill look at HSERIN. I have some 16mghz resonators here. What, if any, is the down side to using them to make the picaxe run faster so it can process the incomming data from the module quicker?
 

hippy

Ex-Staff (retired)
The only downsides are you may have to adjust Pause times, and there will probably be an increase in current consumed.
 

BrendanP

Senior Member
Thanks mate, I was aware of the pause time effect and the current consumption isn't an issue.

I have a program running with the hersetup running in the background recieving the sms's and writting them to the scratch pad. Its a beautifull thing! They sertxd out correctly.

The manual refers to the hserinflag being set on reception of new data. I presume by montioring this flag the program can see when theres new data in the pad. I can't find further refference to the pointer in the manual, have you see it?
 

BrendanP

Senior Member
I've got the setintflag going now and its all working well. I'm very gratefull for you pointing me in the right direction Hippy.
 

BrendanP

Senior Member
Just a bit of an academic query Hippy, Ive noticed that if I try and serout to the terminal and then to the lcd I get distortion of the text. Any idea of why that would happen? I've pasted in the code below.

If I use the 'sertxd' line its OK, if I use the 'serout 4' line its OK I cant use both in the same program though.

for b1 = 1 to 200
'sertxd (@ptrinc)
serout 4, n2400_8,(@ptrinc)
next b1
ptr=0
setintflags %00100000,%00100000
hsersetup off
hsersetup B1200_8,%11
return
 

hippy

Ex-Staff (retired)
With two @ptrinc's the second data won't be the same as the first, if that's the problem.
 

BCJKiwi

Senior Member
Just to absolutely verify that you are looking at the same (and valid) data you could try testing with;
ptr=0
for b1 = 1 to 200
'sertxd (@ptr)
serout 4, n2400_8,(@ptr)
inc ptr
next b1
setintflags %00100000,%00100000
hsersetup off
hsersetup B1200_8,%11
return
 

BrendanP

Senior Member
Thanks guys, I feel like I'm going do a Pathfinder sometimes (not fu(king happy!!!!!!) with this stuff but it is very rewarding when I make progress.

Update: Thanks Kiwi, your piece of code showed me that fault was in my code. Your code brings the text out correctly on both screens. I only started using these new X1 specific commands yesterday.
 
Last edited:
Top