🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.sys.next.programmer
1 messages
1 total messages Started by Read News Mon, 06 Apr 1992 20:45
Connecting HP48sx to NeXTstation
#552
Author: Read News
Date: Mon, 06 Apr 1992 20:45
166 lines
6982 bytes
Organization: Texas A&M University
Keywords: HP48sx, kermit, .kermrc, system()
From: n189ds@tamuts.tamu.edu (Ronald Pomeroy)
Path: tamuts!n189ds

Hi Netters!

I apologize for the bandwidth (length) but this is an 
involved (convolved :-)) provlem.  As a novice programmer
B
I'm probably in over my head - but hey, how else is one 
to learn ? (trial by fire I guess ;-) ). Anyway here's:

1) What I'm trying to accomplish
2) What I've done to get there
3) Where I'm stuck! (what info I need)
		
1) What I'm trying to accomplish:
   I have what I think is the "NeXT of calculators", 
   an HP48sx. What makes it especially cool is that it 
   can communicate via KERMIT with my NeXT (in theory).  
   What's also cool is that it's very programmable.  
   What's not cool is the tiny keyboard!! What I'm 
   trying to do is to write a simple (haha!) NeXTish 
   app (basically an editor) taylored to writing HP48sx 
   programs. Most importantly this "editor" needs to 
   support transferring the program to the calculator 
   via KERMIT.  Other than that it's basically going 
   to a bunch of button-driven macros that type hardcoded 
   text into the editor window.  (doesn't sound so bad
   does it?)

2) What I've done to get there:
   Well, hardware was the first step.  Unfortunately 
   the serial port on the HP48 is rather simple (albiet 
   9600 baud!).  It looks like this:
	
   +---------------------------+ HP 48sx   Description    RS232
   |     +------+              | Pin                      equivalent
   |     | 1234 |              | 1         Chassis Ground      1
   |      \____/               | 2         Transmit data       2
   |                           | 3         Receive data        3
   +---------------------------+ 4         Signal Ground       7
 
  I built a cable which maps to the RS423 port on the 
  NeXT - so far so good. Here's where things get tricky :-).  
  The only way I've been able to get the two machines to 
  talk to each other is to first fire up kermit with my 
  modem (hayes) connected (on /dev/cua) and powered up, 
  then sneeky little me switches the cables.  Now I can
  put the calulator in KERMIT server mode and transfer 
  to my heart's delight. Software.  Well, like I said 
  I'm a novice.  I've done numerous "canned" examples 
  specifically the converter (celcius to degrees),
  and the tutorial from Micheal K. Mahoney (kudos!).  What 
  I have tried to do (just to test the waters) is this: 
 
         I Created a simple two button app with a 
         Controller class and ControllerInstance 
         (subclass of the Object class) with 
         two methods. Here's the .hm files:
         _______________________________________
         
			/* Generated by Interface Builder */

         #import <objc/Object.h>

         @interface Controller:Object
         {
             id	SendButton;
             id	InitButton;
         }

         - KermInit:sender;
         - SendKermit:sender;

         @end

         _______________________________________

         /* Generated by Interface Builder */

         #import "Controller.h"
         #import <stdlib.h>

         @implementation Controller

         - KermInit:sender
         {
             system("kermit -y .kerminit");
	          return self;
         }

         - SendKermit:sender
         {
             system("kermit -s testfile);
	          return self;
         }

         @end
         ________________________________________
      
       The intention was this:  Press the KermInit 
       button with the modem on. The .kerminit looking 
       like this -
ua
      set escape-character 29
      set prompt LocalKermit >>
      set speed 9600
      set file names literal
      set receive packet-length 1024
      set block-check 3
      exit

      This was supposed to open /dev/cua (yea right :-) )
		
      Next, switch the cables so that the HP48sx is now 
      hooked up. Press the SendKermit button so that test
      file is sent to the HP48sx (which is in server mode).
      This is where my logic fails because (among other 
      reasons) when KERMIT is invoked in the SendKermit 
      method, it implicitly reads the .kermrc which must 
      set line /dev/cua again (remember - I've turned off
      off the modem so it won't interfere with communi-
      cation with the HP48sx).  I thought this through and
      have decided this is a road to nowhere (more on this
      in part 3).  Once I've solved the comm problems I'll 
      start worrying about the editor. All that I'd like 
      is some scrolling lists (buttons) of HP48sx
      commands/characters that I can mouse on and have it 
      inserted into the editor window.  

3) Where I'm stuck!

      Communications:  I'd like to get around the 
      /dev/cua/"swithing the cables" bit.  KERMIT allows 
      for a variety of connections like hardwired, network, 
      etc. What other device - as in /dev/ttya (and associated 
      configurations) migh work with a hardware connection 
      such as this?  
      When kermit is called from an application (using system())
      it appears that kermit tries to open /dev/tty.  What's 
      the scoop here?  I thought kermit tried to direct it's 
      output to your home directory by default.

      Editor:  How do built a simple scrolling ASCII editor with 
      the Text (or other) object?  How make a button send text to 
      this editor and insert at the current cursor position?  I've
      experimented a little but would like to start fresh with 
      advice from the pros.

      Am I a just a novice or *completely* brain-dead ?!?! :-)

OK - I know that was long.  Thanks for your patience.  Pleeeaase respond,
flame, comment, suggest, inform whatever.  I've had this beautiful 
black box for a year now and I WANT TO LEARN TO WRITE NeXTstep APPS!!!
I think this thing is doable and within my reach and should provide
a lot in terms of learning to program both in terms of NeXTstep and UNIX.
Thanks in advance.

------------------------------------------------------------------------
|Ronald Pomeroy                  | chinese proverb: There is no such    |
|Senior Electrical Engineering   | thing as a bad student, only a bad   |
|Texas A&M University            | teacher.                             |
|n189ds@tamuts.tamu.edu          | source: fortune cookie               |
------------------------------------------------------------------------
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads