<GHGALAP@cc1.kuleuven.ac.be> (04/17/91)
Hello dear fellow HP-28 hackers, Here my experiences on building an RS232 link to the HP 28S. I have not yet opened it up but I tried to make a connection trough the IR link (Only to the computer). It worked, but not entirely the way it should. Anyway, a good book is : VOYAGE AU CENTRE DE LA HP28c/s Paul Courbis et S{bastien Lalande PARIS, Editions de la R}gle @ calcul 65, Bd Saint- Ger{ain. BP 300, 75288 PARIS CEDEX ISBN : 2.90785.601.4 Oh yes, this book is written in FRENCH ||| (I think the french specific characters will be printed wrong) I don't know if most people on the net understand French, since most of them are in America (I think). By the way , most people here in Belgium talk three or four languages (Dutch, French, English, German). Ain't that unbelievable ? I think it is more or less the only country in the world where so many languages are spoken. Serious now. hardware : ---------- I connected a fototransistor to a transistor to amplify the signal. Switching the IR led on and off resulted in a voltage swing from -5 volt to +5 volt. Connecting this to pin 3 on the RS232 connector (RxD) and connecting GND to pin 7 (signal ground), the computer seemed to receive signals. A voltage swing of 0 to 10 V worked too, 0 to 5 V did not (I think actually it should work). Software : ---------- The following routine takes a "pt" object, so don't call it directly. Compile it into an IMC called "SEND.OBJ" and use "SEND" to do the actual sending. 8F18050 CALL.A SaveRegs 8F72F40 CALL.A GetPt 1BD0FFF MOVE.5 IRLED,D0 308 MOVE.P1 #8h,C ; send 8 bits + 1 startbit 816 RRN.W C ; put counter in field S C4 * loop ADD.A A,A ; shift bit into carry 590 * BRCC zero 302 MOVE.P1 #2h,C 6600 JUMP.3 send 300 zero MOVE.P1 #0h,C 1540 send MOVE.P C,(D0) ; set LED on or off 3162 MOVE.P2 #26h,C ; change this num to change delay A6E wait DEC.B C 5CF BRCC wait ; delay A4E DEC.S C 5FD * BRCC loop ; next bit 300 MOVE.P1 #0h,C ; switch LED off 1540 MOVE.P C,(D0) 8D505B1 JUMP.A continue ; continue rpl 'SEND' ?6B0C! << DUP TYPE IF NOT THEN # C53Bh SYSEVAL SEND.OBJ ; 0CB35: real->pt END DROP >> use : the bits that are to be sent, should be in the left of a 20 bit integer. For example the character "o" is coded as o -> ascii code = #6F ; switch nibbles : F6 invert (sending 1 = receiving 0) :F6 -> 09 adding 1 startbit : #109 ; shift left until startbit is most left : "o" -> #84800 h. to send an "o" do : #84800h B->R SEND. I set my computer to 1200 baud, 8 bits,no parity, 1 stop bit. This routine worked, but the bits are in the wrong order. It takes a lot of work to correct this (as you've seen above)so I changed the program to use right shifting in stead of left shift, but It did not work the way it should. The changes were in the lines marked with an *. 822 loop CLR SB 819F0 SRB.A A 83290 BRBC SB,zero 570 BRCC loop I don't know whether it is necessary to clear the SB, but without this instruction it did not work either. I suspect there is some problem with the timing, I tried changing it but it did not work. Can somebody help me : post some timing info on the ML instructions. Do I have to switch the interrupts off ? Is it easier to use the timer to for timing the bits ? I also had problems with errors that were send trough. Mayby 600 baud is more reliable, but I did not try it. Actually, it was very difficult to get something correct to the computer. Mayby I should do some filtering in the electronics or so ? Can somebody post some info please ? Anyway, I'm now busy opening my 28, and i'm working on some info how you should open it. I'll post it as soon as it is ready. Joris. |--------------------------------------------------------------------| | _ _ | | (_) | | JORIS BALLET | | _ ____ | |___ E-MAIL : GHGALAP@BLEKUL11.BITNET | | | | / \ | / \ | | | | | () | | () | (THIS ADDRES IS SUBJECT TO CHANGE | | __| | \____/ |_____/ DON'T USE AFTER JULI '91 ) | |(___/ | | | |--------------------------------------------------------------------| | PROGRAMMERS DON'T BYTE, THEY JUST NIBBLE A BIT. | |--------------------------------------------------------------------|