west@bnrmtv.UUCP (Andrew West) (10/28/86)
I am planning to use the Macintosh serial port (i.e. modem) to send a block of data to an asynch. interface which will read the data into a small RAM. I will be using some sort of standard start/stop, parity and baud rate setup (I'll worry about the details later when I am actually programing everything). The RAM data will be used as an external routine for an 8051H microcontroller (don't ask--it wasn't my choice). I would like to set up a short file on the Mac with the program already in binary (the routines are short enough that entering a few 1's and 0's is not a big deal) and send the data to the RAM. I would also like to use an existing modem program or perhaps write a quick and dirty routine (at the highest level possible; I'm not proficient in C but do have access to MSBasic and MacPascal). The problem I am having at the moment is that all my modem programs and the poorly documented routine in the MSBasic manual are for sending ASCII characters. I need to be able to send arbitrary bytes, consisting of whatever arrangement of 1's and 0's I need (i.e. if 10101010 were a JMP, I need to download that exactly (along with the normal extra protocol overhead which the Mac should add and the receiving Asycnh chip should strip off), not the ASCII 1, ASCII 0, ASCII 1, etc. that most programs send). Can anyone offer a suggestion as to a existing program I might be able to use, a short code segment that might accomplish this, or a reference that might be helpful. My primary responsiblity for this is the hardware so I would prefer not to spend a lot of time with Inside Macintosh to figure out a bunch of toolbox routines. Thanks for any help or suggestions. Andy West ...bnrmtv!west
dlc@lanl.ARPA (Dale Carstensen) (11/02/86)
> The problem I am having at the moment is that all my modem programs and > the poorly documented routine in the MSBasic manual are for sending ASCII > characters. I need to be able to send arbitrary bytes, consisting of > whatever arrangement of 1's and 0's I need (i.e. if 10101010 were a JMP, I > need to download that exactly (along with the normal extra protocol > overhead which the Mac should add and the receiving Asycnh chip should > strip off), not the ASCII 1, ASCII 0, ASCII 1, etc. that most programs > send). Versaterm and MacTep (vintage mid-1984) will both do what you want. Kermit will not. I haven't used any other terminal emulators, but I imagine about two thirds of them will work. Microsoft BASIC should send binary out the modem port (called device COM1:) if you open it with no parity and eight bits. See page 42 of the version 2.0 manual, or look up device in the index of other revisions. Use PRINT #n, CHR$(BYTE) to send a binary byte. Use INPUT$(1,#m) to read a binary byte from your 8051 executable file on the Mac. How do you get the 8051 code on the Mac? Do you have a cross-assembler for the 8051 that runs on the Mac? (Just curious, you don't have to answer, but if your cross-assembler is on a machine you access with the Mac via a terminal emulator, you were able to get some form of binary transmission to work, but it could have been XMODEM or Kermit, true enough.)