Com4: Problem

For issues with communication ports, protocols, etc.
Post Reply
Dinosaur
Posts: 1481
Joined: Jul 24, 2005 1:13
Location: Hervey Bay (.au)

Com4: Problem

Post by Dinosaur »

Hi All

I am wasting some time working on a new little x86 controller called Educake.
http://www.86duino.com/index.php?p=95

It has Com4; as a DB9 and can very easily be used with the following.
Firstly by putting
mode com4:9600,N,8,1,P
ctty com4
in the Autoexec.bat file and then in FB

Code: Select all

 
PortIn  = FreeFile
Open Cons For Input  As #PortIn
PortOut = FreeFile
Open Cons For Output As #PortOut
Print #PortOut,"Please write something and press ENTER"
Line Input #PortIn,a
Print #PortOut, "You wrote : ";a
Close
But that has severe limitations on what I want to do, so I want to open the port in the usual FB way.

Code: Select all

OPEN Com "COM4:9600,n,8,1,cs0,ds0,cd0,rs" FOR BINARY AS #4
Which hangs.
As I have lots of Asm code going back 30+ Years, I converted some port config statements to FB
Dont ask me to explain the values.

Code: Select all

    Out PortAddr+3,&H80
    Out PortAddr,&H0C
    Out PortAddr+1,0
    Out PortAddr+3,0
    Out PortAddr+3,&H3
    Out PortAddr+1,0
    Naam = "Com4: Open"
    For Xq = 1 To Len(Naam)
        Out PortAddr,Asc(Naam,Xq)
    Next
Which works perfectly.
If I can make this work correctly in Asm, what is wrong with FBDos that I cant get a very simple Open Com to work.
I understand that the processor is a SoC Vortex86 and may have it's oddities.

Regards
MrSwiss
Posts: 3910
Joined: Jun 02, 2013 9:27
Location: Switzerland

Re: Com4: Problem

Post by MrSwiss »

@Dinosaur,

having had a look a couple of months ago, at the very same piece of HW and
seeing the forum posts there ... I've decided to NOT "make the BETA-Tester"
for the product.
I think the producer will have to "deburr and polish" this product before it may
become someting "really usefull".
Therefore I think that your question here is a bit "before it's time", sorry.

Regards MrSwiss
Dinosaur
Posts: 1481
Joined: Jul 24, 2005 1:13
Location: Hervey Bay (.au)

Re: Com4: Problem

Post by Dinosaur »

Hi All

MrSwiss, that is the story of my life, always either looking for something that doesn't exist yet,
or being as you call it the Beta tester.

HOWEVER,,,,

I have done a lot of work on this device, and not knowing / understanding the delicacies of PCI bus programming is the only
problem encountered sofar.
Being a SoC, there will always be differences but that exists at every level of industrial cpu's as well.

For the moment, I am using "Open Cons" for my link to the laptop and after a lot of trial & error concluded that reading
Inp(&H2E8 + 5) And 1 'see if char waiting
overcomes the problem of hanging in there waiting for a Cr/Lf.

Would be interesting to see the source code for the com ports and work out what FB is doing different.

Regards
TJF
Posts: 3809
Joined: Dec 06, 2009 22:27
Location: N47°, E15°
Contact:

Re: Com4: Problem

Post by TJF »

Hi Dinosaur!

Why do you try connecting to COM? The device has USB and LAN. Wouldn't it be better to use the modern interfaces?
Dinosaur
Posts: 1481
Joined: Jul 24, 2005 1:13
Location: Hervey Bay (.au)

Re: Com4: Problem

Post by Dinosaur »

Hi All

TJF, the unit does not have a monitor adapter, so the easiest way to get a display of what
it is doing is by redirecting the Console.

I have other intentions for the usb, but the ethernet is what I am currently trying to setup
with Wattcp so that I can Map a network drive from XP.
The comport will eventually drive an LCD.

The question still exist though:
If by following all the normal addressing rules of a 16550 with asm code works,
then why does opening the port with FB not work ?

Regards
TJF
Posts: 3809
Joined: Dec 06, 2009 22:27
Location: N47°, E15°
Contact:

Re: Com4: Problem

Post by TJF »

Dinosaur wrote:TJF, the unit does not have a monitor adapter, so the easiest way to get a display of what
it is doing is by redirecting the Console.
Yes, but why not doing this using the LAN port?
Dinosaur
Posts: 1481
Joined: Jul 24, 2005 1:13
Location: Hervey Bay (.au)

Re: Com4: Problem

Post by Dinosaur »

Hi All

TJF, I didn't know that, BUT it is Chicken & Egg situation.
I have to get Ethernet working before I can use that.
So, to initially see what the output is the serial was still the best option.

I will investigate what & how useful ssh is.

Regards
Post Reply