English Amiga Board


Go Back   English Amiga Board > Coders > Coders. System

 
 
Thread Tools
Old 25 August 2014, 17:50   #1
vext01
Registered User
 
Join Date: Nov 2012
Location: UK
Posts: 137
Serial programming in ACE basic on A600.

Hi,

I am trying to figure out how to do serial programming in ACE basic. My setup is as follows:

* A600 with ACE (GPL release) installed to HD (CF).
* A600 serial pport connected to USB to serial device.
* USB serial plugged into laptop running OpenBSD.

To start with, I just want to open the serial device on the amiga side. Looking at the ACE basic documentation (http://www.users.on.net/~dbenn/docs/ref.html), the following program should open the serial port on the A600:

Code:
print "error code:";err
serial open 1,0,9600,"N81",1024
print "error code:";err
So we are opening the first serial line with "normal" parameters, 8 data bits, 1 stop bit and no parity on channel 1 and a buffer of 1024 bytes. I have wrapped `err` calls around the open so that we can isolate any error which may be occurring.

I compile, assemble and link the program using `bas` and a binary falls out. However, when this is run we get:

Code:
error code: 0
error code: 300
Where error code 300 is indicating that `serial open` could not open the serial port. But why?

I have also tried using the second serial line (unit 1) but alas, the same.

So really I have fallen at the first hurdle. Does anyone know what is wrong here? I'm starting to suspect ACE does not work on the A600. Maybe a discrepancy in the serial hardware (between the other systems).

vext01 is offline  
Old 25 August 2014, 19:25   #2
thomas
Registered User
 
thomas's Avatar
 
Join Date: Jan 2002
Location: Germany
Posts: 7,021
Quote:
Originally Posted by vext01 View Post
Maybe a discrepancy in the serial hardware (between the other systems).
I hope it does not poke into hardware registers but rather uses serial.device.

First check if the serial port works at all. Open a Shell window and enter

echo >ser: "hello world"

If this succeeds, run SnoopDOS before you run your Basic program. The log should show if it tries to open serial.device and perhaps even why it fails.
thomas is offline  
Old 25 August 2014, 20:05   #3
vext01
Registered User
 
Join Date: Nov 2012
Location: UK
Posts: 137
Hi Thomas,

Thanks for the echo trick. Using this I was able to debug my program.

Basically, if you forget to close the serial port in your program (as I had), you render it useless until a reboot (or until you issue some command I don't yet know about). So after adding a "serial close 1" to the program it works every time!



P.S.

I had a play with snoopdos and ace basic indeed uses serial.device. Which I believe is a good thing
vext01 is offline  
Old 25 August 2014, 20:07   #4
alkis
Registered User
 
Join Date: Dec 2010
Location: Athens/Greece
Age: 53
Posts: 720
This is what I get from the 3-liner you posted when compiled (with ACE) and run three times.
Code:
3.Work:t/ace/alkis> ser
error code: 0 
error code: 0 
3.Work:t/ace/alkis> ser
error code: 0 
error code: 300 
3.Work:t/ace/alkis> ser
error code: 0 
error code: 300
Are you sure you are releasing the device before you exit?
alkis is offline  
Old 25 August 2014, 21:21   #5
vext01
Registered User
 
Join Date: Nov 2012
Location: UK
Posts: 137
@alkis -- yep, that was the issue. See the above post.
vext01 is offline  
Old 27 August 2014, 23:34   #6
vext01
Registered User
 
Join Date: Nov 2012
Location: UK
Posts: 137
By the way. Does anyone know if there is a quick way to release the serial port in case a program holding the serial channel open crashes? Right now I have to reboot every time...
vext01 is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
PC Serial to Amiga Serial lesta_smsc support.Hardware 48 02 December 2015 10:14
Manuals for GFA Basic and Hi-Soft Basic 2 ricky500 request.Apps 20 12 February 2013 21:06
Ace alexh AMR contributions 6 14 August 2011 15:47
Free Hat!!! Free Hat!!! Sorry I mean Free ZX Spectrum basic Programming Book fitzsteve MarketPlace 3 02 April 2010 18:48
Just got A600, need some basic help misjah New to Emulation or Amiga scene 7 28 October 2009 03:06

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 21:25.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.07946 seconds with 13 queries