The Museum of HP Calculators

HP Forum Archive 14

[ Return to Index | Top of Index ]

HP48 - Motorola MC68HC08 SCI
Message #1 Posted by Mauricio Jaramillo on 11 July 2004, 10:16 p.m.

Hi, how can i communicate my HP48GX with an Motorola HC908KX8 microprocessor by RS232 SCI?

      
Re: HP48 - Motorola MC68HC08 SCI
Message #2 Posted by Bill Wiese on 12 July 2004, 1:11 p.m.,
in response to message #1 by Mauricio Jaramillo

Hi Mauricio...

HC08s are nice little CPUs! :) Which variation are you using, how much ROM & RAM? What else does this CPU have to do beside communicate with the HP48?

I'm not an HP48 owner/user but have done a lot of serial comm work for other embedded widgets. I seem to recall the HP48 does (sometimes? always?) use a form of the Kermit transfer protocol for transfers. I'm not sure if 48 user programming can do byte-by-byte serial communications.

I also don't recall the HP48 bitrates/ parity/ stopbits anymore - or even if it configurable by a user program - but when I looked years ago I recall it was something standard.

The HP48 serial port, IIRC, is at a logic level (+5VDC, swinging down to 0V) -- whereas 'true' RS232 communication requires a level converter to deal with swings between +9 to +12VDC and -9 to -12VDC.

So you can connect the 'HC08 to the HP48 directly without an intervening level converter device (like Maxim's MAX232) if your 68HC08 is a 5 Volt CPU. A 3.3V 68HC08 CPU might be problematic but might work. Just set up your SCI port on the HC08 for the proper bitrate, parity, stop bits. Do not use hardware RTS/CTS handshaking.

If the 48 can only communicate using Kermit protocol, and if you're using a C compiler on the 08, you should be able to get Kermit open source code and 'trim the fat' (i.e, remove useless features') to keep code size down to what you can fit in your HC08.

Bill W
San Jose CA

            
Re: HP48 - Motorola MC68HC08 SCI
Message #3 Posted by Eric Smith on 12 July 2004, 2:15 p.m.,
in response to message #2 by Bill Wiese

Quote:
The HP48 serial port, IIRC, is at a logic level (+5VDC, swinging down to 0V) -- whereas 'true' RS232 communication requires a level converter to deal with swings between +9 to +12VDC and -9 to -12VDC.

So you can connect the 'HC08 to the HP48 directly without an intervening level converter device (like Maxim's MAX232) if your 68HC08 is a 5 Volt CPU.


You might get away electrically with connecting it directly, but it won't work unless you bit-bang the UART rather than using the hardware UART. EIA-232 drivers and receivers are inverting, so if you connect it directly you'll have the wrong polarity.

I highly recommend using a MAX232 or one of the many equivalent parts. That way you can hook the device up to any EIA-232 devices without risking damage, and you have better ESD protection than using a port pin directly.

If you use some kind of evaluation board, it's likely that there's already a level converter present.

                  
Re: HP48 - Motorola MC68HC08 SCI
Message #4 Posted by Bill Wiese on 12 July 2004, 6:04 p.m.,
in response to message #3 by Eric Smith

Hi Eric...

All I was saying was _if_ the HP48 was running 5V serial w/o a MAX232 he could directly connect it to a 5V 'HC08, and that maybe a 3.3V HC08 could work too. No inversions, etc. required...

Bill W San Jose

                        
Re: HP48 - Motorola MC68HC08 SCI
Message #5 Posted by Eric Smith on 12 July 2004, 10:01 p.m.,
in response to message #4 by Bill Wiese

Quote:
All I was saying was _if_ the HP48 was running 5V serial w/o a MAX232 he could directly connect it to a 5V 'HC08, and that maybe a 3.3V HC08 could work too. No inversions, etc. required...

But the inversion IS required, if you want to use the hardware UART. UARTs have logic levels that are high for space, low for mark. But EIA-232 (even the non-really-EIA-232 of the HP-48) is negative (or in the case of the HP-48, not very positive) for space, and positive (on the HP-48 more positive) for mark.

Example of the transmission of an uppercase letter "E" (0x45):

+2V ____      ____      ____                ____      ____
TTL     \____/    \____/    \____.____.____/    \____/
GND      start LSB                                MSB stop
                1    0    1    0    0    0    1    0

+V ____ ____ ____.____.____ ____ EIA ____/ \____/ \____/ \____/ \____ -V start LSB MSB stop 1 0 1 0 0 0 1 0

So if you hook up the HP-48 directly to the UART of a 5V 'HC08, it isn't going to break the 'HC08 (or the HP-48), but it also isn't going to work correctly.

If you implement a software (bit-banged) UART, you can obviously deal with the inversion in software.

            
Re: HP48 - Motorola MC68HC08 SCI
Message #6 Posted by Jonathan Purvis (New Zealand) on 13 July 2004, 4:42 p.m.,
in response to message #2 by Bill Wiese

Not true! The HP48 does use "true" RS-232 voltage at +/-4.3V, even if they are not the 12V you're used to getting out of a PC's serial port. Quoting Preston Brown from the comp.sys.hp48 FAQ:

Quote:
The 48 has two power supplies VDD at 4.3 and VH at 8.5. VH cannot be regulated higher without exceeding the spec for our CMOS IC process. VH is used as the + voltage for the I/O. In order to meet a +3V output level VH must be more then 3.6V above VDD. (VDD is used as I/O ground). Our power supply system increase the battery life and reduces the cost greatly for the wired I/O.

            
Re: HP48 - Motorola MC68HC08 SCI
Message #7 Posted by James M. Prange on 16 July 2004, 12:37 p.m.,
in response to message #2 by Bill Wiese

Quote:
The HP48 serial port, IIRC, is at a logic level (+5VDC, swinging down to 0V)

You recall incorrectly. Maybe you were thinking of a Sharp model?

For transmitting, it's (minimum) +3.0V for a space and -3.0V for a mark, and "typically" +3.5V and -3.5V.

For receiving, it's +1.0V to +15.0V for a space, and -15.0V to -0.3V (Maybe this should be +0.3V, or even -0.03V or +0.03V?) for a mark.

The absolute maximums are listed as -25V to +25V.

Quote:
-- whereas 'true' RS232 communication requires a level converter to deal with swings between +9 to +12VDC and -9 to -12VDC.

Actually, if I recall correctly, RS-232 is supposed to transmit at at +5.0V to +15.0V for space, and -15.0V to -5.0V for mark, and receive at +3.0V to +25.0V for space, and -25.0V to -3.0V for mark.

So, although it doesn't fully comply with RS-232, it's generally RS-232 compatible.

Information about the 48 series I/O is available at http://www.hpcalc.org/details.php?id=1722 and http://www.hpcalc.org/details.php?id=4741.

Quote:
If the 48 can only communicate using Kermit protocol,

The 48 series can also use "raw" serial I/O. That is, without any file transfer protocol; just sending and receiving strings with the length limited only by available memory. That's what the XMIT and SRECV commands are all about. Optionally, XON/XOFF software flow control can be enabled for sending and/or receiving. The input buffer is only 255 bytes and buffer overruns are quite likely to occur if you try to receive longer strings without using software flow control. A variety of parity/pseudo-parity options are also available.

Actually, the printing commands (with flag -34 set, "Print via wire") are a lot like XMIT, but decompile an object to a string form before actually transmitting it from the I/O port.

The 48G series also has the Xmodem protocol built-in, and an "Xmodem Server" library is included with the Conn4x package.

The built-in speeds on the 48 series are 1200, 2400, 4800, and 9600 bps.

But "Serial IR" is 2400 bps only, and is half-duplex instead of full-duplex, so software flow control isn't available in this mode.

The 49G series is similar to the 48G series for I/O via wire, but IR isn't available, and XON/XOFF software flow control is broken for both transmitting and receiving. The 49G has the Xmodem server built-in, and has additional (non-standard) speeds of 1920, 3840, 7680, and 15360 bps built-in.

Regards,
James


[ Return to Index | Top of Index ]

Go back to the main exhibit hall