home *** CD-ROM | disk | FTP | other *** search
/ The Hacker's Encyclopedia 1998 / hackers_encyclopedia.iso / zines / phrack2 / p48_07.txt < prev    next >
Encoding:
Text File  |  2003-06-11  |  42.2 KB  |  1,046 lines

  1.                               ==Phrack Magazine==
  2.  
  3.                  Volume Seven, Issue Forty-Eight, File 7 of 18
  4.  
  5.  
  6.                    TANDY / RADIO SHACK CELLULAR PHONES
  7.  
  8.            REBUILDING ELECTRONIC SERIAL NUMBERS AND OTHER DATA
  9.  
  10.  
  11.                              By Damien Thorn
  12.  
  13.  
  14.  
  15.  
  16.                                 LEGAL CRAP
  17.  
  18. (mandated by our cheap-suit, can't afford cigars, polyester-pants-wearing,
  19. no-practice-having, almost dis-barred, old-fart legal counsel who only charges
  20. us $20 / hour because he meant to retire when he was 70 but lived a few years
  21. longer than he expected...hell, we love him!)
  22.  
  23. Contents copyright 1994, 1995  Phoenix Rising Communications.
  24. Software copyright 1993, 1994, 1995 as indicated.
  25.  
  26. All Rights Reserved.  Distribution of contents in hard-copy form is forbidden.
  27. Redistribution in electronic form is permitted only as outlined in the Phrack
  28. licensing agreement, provided this article is not segregated from the other
  29. editorial contents of Phrack #48.
  30.  
  31. Use caution when rebuilding corrupt serial numbers, and avoid lending your
  32. talents to further the goals of unscrupulous people.
  33.  
  34. Altering the serial number of a cellular transceiver is a violation of the
  35. FCC rules, and the U.S. Secret Service is charged with the responsibility
  36. of investigating fraudulent activity.
  37.  
  38. All of this material was developed in-house and not provided or
  39. endorsed by the manufacturer.  Brand names and trademarks are used for
  40. identification purposes only and are the property of their respective
  41. owners.  Use of same within this article definitely does not imply agreement
  42. with or endorsement of the material presented, and probably aggravates them
  43. to no end.   There are no guarantees or warranties with regard to the accuracy
  44. of this article.  Although we've done the best job that we can, we may be
  45. wrong.  Happens all the time.  If you damage a phone or inadvertently start
  46. a global thermonuclear war, that's your problem.  Don't come crying to us, or
  47. make us fork over another twenty bucks to the old shyster. What you do with
  48. this information is your responsibility.
  49.  
  50.  
  51.                                INTRODUCTION
  52.  
  53.                                      
  54. While manufacturers publish service manuals for their cellular
  55. transceivers, they have an annoying habit of omitting certain
  56. data pertaining to memory devices and the arrangement of the data
  57. stored inside them.  Since this stored information includes the
  58. electronic serial number (ESN), the lack of documentation can
  59. easily be excused as a way to avoid unwittingly facilitating
  60. fraud.
  61.  
  62. The drawback to the 'security through obscurity' approach is that
  63. service technicians who have a legitimate need to reprogram these
  64. memory devices are unable to do so.  The Nokia-designed
  65. transceivers discussed in this article are an excellent example. 
  66. Since the ESN is stored in the same electrically-erasable
  67. programmable read-only memory (EEPROM) device as the numeric
  68. assignment module (NAM) information, corruption of the data can
  69. be catastrophic to the operation of the phone.
  70.  
  71. Since the handset programming mode of these Nokia units actually
  72. write-enables the memory device to store the alterable parameters,
  73. an errant pulse from the microprocessor, dropped bits or supply
  74. voltages falling out of tolerance can cause the ESN or checksum
  75. to become overwritten or otherwise rendered useless.  Should this
  76. occur, dealers have had little recourse but to ship the
  77. transceiver back to the factory for repair.  Until now, that is.
  78.  
  79. The goal of Phoenix Rising Communications in producing this
  80. documentation is to empower technicians to do the job they have
  81. been educated and hired to perform.  This guide to Tandy and
  82. Radio Shack cellular phones will enable the technician to rebuild the
  83. corrupt data within this series of transceivers with confidence.
  84.  
  85. The information in this article was developed from the installed
  86. and transportable versions of the most commonly purchased phones
  87. from Radio Shack stores.  These units were sold for many years,
  88. and finally replaced last year with a new, redesigned model.  The
  89. data presented here can probably be applied to certain compatible
  90. Nokia transceivers as indicated later in the text. 
  91.  
  92.  
  93.                                  CHAPTER 1
  94.  
  95. This publication is designed to provide supplemental information
  96. to assist in the servicing of cellular mobile telephones
  97. manufactured by Tandy Corporation under license from the Nokia Corporation. 
  98. It is not meant to be a replacement for the factory service manual. 
  99. Any shop needing to perform component level repairs should
  100. definitely obtain the factory documentation from Tandy National
  101. Parts.
  102.  
  103. Our primary goal is to explain the contents of the numeric
  104. assignment module, or NAM.  In these particular phones, both the
  105. NAM parameters and the electronic serial number (ESN) are stored
  106. within the same electrically erasable programmable read-only
  107. memory (EEPROM) device.
  108.  
  109. The problem inherent with this engineering decision is that the
  110. ESN stored within this chip is not necessarily permanent.  Since the
  111. chip can be erased or reprogrammed, certain circumstances could
  112. possibly cause the ESN to become corrupt.  These include improper
  113. signals from the microprocessor, induced currents or a power
  114. interruption during NAM programming as the write cycle is taking
  115. place.
  116.  
  117. Since the available service literature does not describe the
  118. functions of this serial EEPROM or the data contained within,
  119. service personnel would have to return the transceiver to the
  120. manufacturer for service.  This is not cost effective in terms of
  121. time or money for either the shop or cellular customer.
  122.  
  123. Technicians who invest a little time to become familiar with the
  124. data stored within the NAM circuitry, including the placement of
  125. the ESN and checksum byte can service these types of problems
  126. in-house and with little difficulty.
  127.  
  128. Basic instructions for peaking the transceiver's RF sections have
  129. also been included herein as a convenience.  While the phone is
  130. open and on the test bench, the customer's transceiver should
  131. also be given a quick check for proper alignment.
  132.  
  133.                             EQUIPMENT REQUIRED
  134.  
  135. Other than basic hand tools, disassembly of the phone requires a
  136. soldering iron with a medium sized tip and a vacuum de-soldering
  137. tool.  Good size solder removal braid may be used in conjunction
  138. with, or in lieu of the de-soldering tool.
  139.  
  140. To correct data that has become corrupted within the EEPROM, a
  141. programming device is required capable of reading and burning an
  142. 8-pin DIP integrated circuit.  One such inexpensive device is
  143. listed in appendix III.
  144.  
  145. An individual who is familiar with the memory device involved has
  146. written a software program in the BASIC language to allow the
  147. programming of this chip via the parallel port of an
  148. IBM-compatible personal computer.  The source code for this program
  149. can be found in the appendix, and is provided as a reference only.  Such
  150. software is subject to the peculiarities of the host PC and
  151. therefore cannot be recommended for use in place of a standard PROM
  152. programmer.  Older versions of GWBASIC are preferred to Microsoft's
  153. current QBASIC interpreter.
  154.  
  155.                               MODELS COVERED
  156.  
  157. The information presented is believed to cover all of the installed
  158. and transportable (bag phone) cellular transceivers manufactured
  159. by the Tandy Corporation under license from the Nokia Corporation up
  160. until about a year ago.
  161.  
  162. Tests have been conducted on a random selection of these phones
  163. with manufacture dates ranging from 1989 through early 1994.  All
  164. versions of the "TP" firmware through January, 1994 should be
  165. supported.
  166.  
  167. Although no house-branded OEM Nokia transceivers have been
  168. tested, we have surmised that this information is applicable to several
  169. models based on the same or a similar design.  These models
  170. include the Nokia LX-11, M-11, M-10 and the Nokia-Mobira P4000 (PT612). 
  171. Some of these units, like the very old Radio Shack equivalents,
  172. will require a service handset to program.  More on that in the
  173. next issue of Phrack.
  174.  
  175.                               HAND-HELD UNITS
  176.  
  177. Only one of the hand-held cellular phones previously sold through
  178. Radio Shack utilizes a discrete surface-mounted integrated
  179. circuit to store the ESN and NAM parameters.  If you have the capability
  180. to read and program this SOIC 93C46 memory device you may be able to
  181. extrapolate the PROM dumps in this guide to work with this phone.
  182.  
  183. Due to the difficulty in disassembling this unit and the delicate
  184. nature of the surface-mounted EEPROM, the reader is cautioned
  185. against attempting to service these in-house.
  186.  
  187.                                 DISASSEMBLY
  188.  
  189. Prior to disassembling the transceiver, all antenna and cables,
  190. including the handset, should be disconnected from the jacks on
  191. the unit.
  192.  
  193. To aid in disassembly and component location, the original
  194. hard-copy version of this publication contained several pages of
  195. photographs.  While the hard-copy version is available (see end of
  196. article), you will hopefully be able to figure out what we're talking about
  197. without them.
  198.  
  199. Disassembly begins by snapping the plastic end panel from the
  200. black transceiver cover.  Some units just pop up and off, while others
  201. have two small plastic tabs on each side that must be depressed
  202. free the end panel for removal.
  203.  
  204. With the end panel removed, the top plastic cover is now free to
  205. slide off.  With this cover removed, the metal transceiver itself
  206. can be dumped from the remaining plastic housing by turning it
  207. upside down, or pulling up on the metal heat sink assembly that
  208. comprises one side of the transceiver unit.
  209.  
  210. There is a metal shield on each side of the transceiver (top and
  211. bottom.)  One is a solid piece of thin sheet metal, and the other
  212. is broken up in to smaller, individual shields and soldered to
  213. the transceiver chassis.  The shield that needs to be removed is the
  214. solid one.  It is only held in place with the friction grips
  215. along the edges, and can be pried off with your fingers.
  216.  
  217. Once the shield is removed from the proper side of the
  218. transceiver, the solder side of the logic board will be exposed.
  219. This board must be removed to gain access to the component side.  Take
  220. static precautions so as not to fry the CMOS silicon that is currently
  221. hidden from view. 
  222.  
  223. Other than several connectors that mate between the two boards,
  224. the board is usually held in place by several blobs of solder spaced
  225. along the edge of the board.  These small 'solder welds' serve as
  226. a ground bond between the board and the transceiver chassis, and
  227. are not electrically necessary under normal circumstances.
  228.  
  229. Once the solder ground bonds have been melted and removed with a
  230. de-soldering tool or solder wick, use a pair of needle-nose pliers
  231. to gently bend back the small metal tabs holding the circuit
  232. board in place.
  233.  
  234. Before proceeding, inspect the foil side of the board to ensure
  235. that no solder has splashed on the board during de-soldering, and
  236. that the foil traces where the work was performed are still
  237. intact.  This last step is where most trouble arises.  These boards are
  238. delicate, and a heavy hand while prying or bending will almost
  239. ensure that a trace or five will be transected when the tool
  240. slips.  If this happens, resolder the traces to undo the damage.
  241.  
  242. At this point the logic board is held in place only by pins on
  243. the transceiver board sticking up in to sockets on the logic board. 
  244. Gripping the edges of the logic board with your fingers and
  245. pulling straight up will disengage the connectors and allow the logic
  246. board to pull free of the transceiver.  Slightly rocking the board from
  247. each side may aid in the removal.  Do not grip the board with
  248. pliers or damage can result to the small chip resistors and other
  249. components mounted on the solder side of the board.
  250.  
  251. Once dislodged, you'll have two separate circuit boards.   
  252.  
  253.                               THE LOGIC BOARD
  254.  
  255. The board that supplies logic and control functions for the
  256. cellular mobile telephone is easily identifiable by the
  257. microprocessor and 27C512 EPROM containing the operating
  258. firmware.  The EPROM's erase window is covered by a protective sticker
  259. that identifies the firmware version stored therein.  Within the last
  260. few years, the version has ranged from TP-2 through TP-8.
  261.  
  262. Also on this board is the serial EEPROM where the ESN and NAM
  263. parameters are stored.  This chip is an 8-pin DIP located in a
  264. socket near pin #1 of the NEC microprocessor.  It is usually
  265. covered with a small paper sticker bearing the last few digits of
  266. the serial number stored inside.
  267.  
  268. While security experts may blast Nokia for designing a phone that
  269. stores the ESN in a socketed chip, and then says "here I am" by
  270. placing a sticker on it, this is a dream come true for any
  271. technician facing issues of data corruption.  
  272.  
  273.                              THE SERIAL EEPROM
  274.  
  275. The Serial EEPROM containing all of this data is a PCD8572 (or
  276. 85C72) manufactured by Microchip Technology, Inc.
  277.  
  278. This 8-pin device is a 1k (128x8) CMOS serial electrically
  279. erasable PROM.  The pin configuration for the device can be found in the
  280. appendix.
  281.  
  282. Power is supplied to this chip only when the microprocessor is
  283. performing a read or write operation.  Transistor Q115 (surface
  284. mounted to the underside of the logic board right about in the
  285. middle) switches the supply voltage on and off.  Should power be
  286. interrupted during the write cycle, the ESN may become corrupt.
  287.  
  288.                             REBUILDING THE ESN
  289.  
  290. To replace the damaged serial number, note the unit's serial
  291. number from the cellular service agreement or the phone itself.
  292. The ESN (in decimal) is located on a white paper sticker applied to the
  293. side of the metal transceiver chassis.  It is also stamped into the
  294. plastic model identification plate on one side of the plastic
  295. outer housing.
  296.  
  297. For reprogramming, the ESN must be converted to hex.  A scientific
  298. calculator or any number of public domain computer programs will
  299. simplify the task.
  300.  
  301.                           CONTENTS OF NAM
  302.  
  303. Once the original serial number has been determined, carefully
  304. remove the 8572 EEPROM from the socket and place it in the
  305. adapter required by your PROM programmer.  Reading the contents of the
  306. chip, you'll see data as depicted below.
  307.  
  308. Note that these data dumps are simulated for illustrative purposes.
  309. The ESN and encoded MIN bytes are not legitimate numbers, so don't
  310. bother 'testing' them.
  311.  
  312. The first five bytes of data contain the security code.  These
  313. bytes are the hex values representing ASCII characters 0 through
  314. 9, thus represented as "3X" where "X" is the actual digit of the
  315. security code.  A factory security code of 1 2 3 4 5 would be
  316. represented in bytes 00 through 04 as follows:
  317.  
  318. 31 32 33 34 35
  319.  
  320. Since you will require the security code to enter handset
  321. programming mode, please note the current security code or
  322. program these bytes with your shop's standard default.
  323.  
  324.                      UNDERSTANDING ADDRESSES
  325.  
  326. Some cellular technicians have little experience in the digital
  327. world.  Service monitors and watt-meters are expensive and wonderful
  328. devices, but sometimes you need to do a little more than tweak a pot
  329. to fix a phone.  The digital-literate can skip this oversimplified
  330. explanation.
  331.  
  332. To assist those in reading the locations of the various bytes in the EEPROM,
  333. understand that each line (as usually displayed on a programmer) contains
  334. sixteen (16) bytes.  The first line begins with byte 00, then 01, 02, 03,
  335. 04, 05, 06, 07, 08, 09, 0A, 0B, 0C, 0D, 0E and finally 0F.
  336.  
  337. The second line begins with 10, then 11, 12, 13, 14, 15, 16, 17,
  338. 18, 19, 1A, 1B, 1C, 1D, 1E, and 1F as the last byte of the line. 
  339. The third line increments the same way, except as byte 30, 31,
  340. etc., to 3F.  You now know how to count in base 16 (hex)! 
  341.  
  342. As an example, the locations used by the phone end at byte 3D,
  343. which contains 00 in the example below.  Beginning with the next
  344. byte (3E), a repetitive pattern of alternating values of AA and
  345. 55 are stored.  This is just 'test' data and is never read by the
  346. phone.  The chip itself ends at byte 7F, and your PROM programmer
  347. may display FF following byte 7F to indicate the non-existence of
  348. these locations in the chip.
  349.  
  350.    
  351.                      8572 EXAMPLE DATA DUMP
  352.  
  353.  
  354.           0000 31 32 33 34 35 0A FF 21 A5 38 25 82 0F 25 17 1A
  355.           0010 00 00 00 00 24 15 B1 C3 24 04 A3 21 16 2D 11 AA
  356.           0020 0A 00 00 64 6C B3 32 00 27 00 01 01 11 11 11 11
  357.           0030 11 08 4D 01 0F 01 0F 00 04 00 00 00 FF 00 AA 55
  358.           0040 AA 55 AA 55 AA 55 AA 55 AA 55 AA 55 AA 55 AA 55
  359.           0050 AA 55 AA 55 AA 55 AA 55 AA 55 AA 55 AA 55 AA 55
  360.           0060 AA 55 AA 55 AA 55 AA 55 AA 55 AA 55 AA 55 AA 55
  361.           0070 AA 55 AA 55 AA 55 AA 55 AA 55 AA 55 AA 55 AA 55 
  362.  
  363.  
  364.                     THE CRUCIAL SERIAL NUMBER
  365.  
  366. The hex ESN for any given phone consists of four bytes, as we use
  367. the term here.  Technically it is eight bytes (in hex, 32 bits if
  368. expressed in binary form), but we're referring to a 'byte' as a two-digit
  369. hex number, rather than each digit (byte) as a single entity.  For our
  370. example, we're using the fictitious ESN of A521FF0A.  All Radio Shack
  371. phones will have an ESN beginning with A5 hex.  This is the "manufacturers
  372. code" prefix that has been assigned to Tandy.
  373.  
  374. Breaking the ESN into four bytes as viewed on the PROM programmer,
  375. the ESN would appear as:
  376.  
  377.                           A5 21 FF 0A
  378.  
  379. Refer back to the example dump of the data within the 8572 IC. 
  380. Immediately following the security code is the ESN stored in
  381. reverse order.  With the security code occupying bytes 00 to 04,
  382. the ESN is located in bytes 05, 06, 07 and 08.  Byte 09 contains
  383. the value 38.  It should always contain 38.
  384.  
  385. In the example, beginning with byte 05 you can read the ESN (in
  386. reverse sequence) as:
  387.  
  388.                          0A FF 21 A5
  389.  
  390. The examples below will assist you in visualizing the bytes
  391. containing the security code and the electronic serial number. 
  392. The programming and placement of these two crucial pieces of data is
  393. fairly straight forward.  Using the buffer editor function of the
  394. PROM programmer, you can simply type over the garbage that may be
  395. present in these locations with the correct values for the
  396. security code and the ESN.  Double check your data entry!
  397.  
  398.                       OTHER ADDRESSES
  399.  
  400. The entire NAM data is stored in the remaining locations of this
  401. chip.  Bytes 0A, 0B and 0C contain the firmware revision date,
  402. and bytes 0D - 0F contain the installation date as programmed via the
  403. handset programming mode.
  404.  
  405. Other bytes contain the encoded Mobile Identification Number
  406. (MIN), Station Class Mark (SCM), etc.
  407.  
  408. These various bytes do not need to be reprogrammed through your
  409. PROM burner, as they can all be corrected via handset
  410. programming.  Only the security code and ESN must be properly reprogrammed
  411. directly to the chip itself.  For more information on the locations
  412. of this other data, refer to the source code in Appendix A.  It
  413. allows you to see where (and how) this other data is stored within
  414. the NAM.
  415.  
  416. The last item to program is the checksum.
  417.  
  418.  
  419. THE SECURITY CODE:  BYTES 00 - 04
  420.  
  421.           0000 31 32 33 34 35 XX XX XX XX XX XX XX XX XX XX XX
  422.  
  423.      
  424. THE ESN:  BYTES 05 - 08
  425.  
  426.           0000 XX XX XX XX XX 0A FF 21 A5 XX XX XX XX XX XX XX
  427.  
  428.  
  429.                     LOCATING THE CHECKSUM
  430.  
  431. There is a one byte device checksum stored within the 8572 that
  432. is used by the phone to check the integrity of the data stored
  433. therein.  The checksum is located at byte 3D, indicated by "XX"
  434. in the example below.
  435.  
  436. The checksum is derived from all the data stored in the NAM, not
  437. just the ESN.  Computing it is relatively easy as it is simply
  438. the sum (in hex) of all the values from bytes 00 through 3C as
  439. underlined below.
  440.  
  441. Assuming the PROM programmer has a checksum function, you can
  442. enter the beginning address as 0000 and the ending address as 003C. 
  443. The software will add all of the values between these locations and
  444. give you the sum.  The alternative is to add the numbers manually
  445. using the hex mode of a scientific calculator.  Either way, adding
  446. the hex values of all the bytes between 00 and 3C of our example yields
  447. a sum of 0B5E.
  448.  
  449. The least significant two-digit byte is the actual device
  450. checksum that would be programmed in location 3D.  In our example, the
  451. least significant half is 5E.  Ignoring the most significant half of
  452. the sum (0B), a value of 5E must be programmed to location 3D.
  453.  
  454. Note that the checksum will be recomputed and change after
  455. handset programming.  When the MIN or other data is changed, it alters
  456. the values in various bytes.  The checksum encompasses all of the
  457. data stored within the chip used by the transceiver's firmware.
  458.  
  459.                           CHECKSUM LOCATION
  460.  
  461.           0000 31 32 33 34 35 0A FF 21 A5 38 25 82 0F 25 17 1A
  462.           0010 00 00 00 00 24 15 B1 C3 24 04 A3 21 16 2D 11 AA
  463.           0020 0A 00 00 64 6C B3 32 00 27 00 01 01 11 11 11 11
  464.           0030 11 08 4D 01 0F 01 0F 00 04 00 00 00 FF XX AA 55
  465.           0040 AA 55 AA 55 AA 55 AA 55 AA 55 AA 55 AA 55 AA 55
  466.           0050 AA 55 AA 55 AA 55 AA 55 AA 55 AA 55 AA 55 AA 55
  467.           0060 AA 55 AA 55 AA 55 AA 55 AA 55 AA 55 AA 55 AA 55
  468.           0070 AA 55 AA 55 AA 55 AA 55 AA 55 AA 55 AA 55 AA 55 
  469.  
  470.  
  471.                    BYTES SUMMED TO DERIVE CHECKSUM
  472.  
  473.           0000 31 32 33 34 35 0A FF 21 A5 38 25 82 0F 25 17 1A
  474.           0010 00 00 00 00 24 15 B1 C3 24 04 A3 21 16 2D 11 AA
  475.           0020 0A 00 00 64 6C B3 32 00 27 00 01 01 11 11 11 11
  476.           0030 11 08 4D 01 0F 01 0F 00 04 00 00 00 FF .. .. ..
  477.           0040 .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
  478.           0050 .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
  479.           0060 .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
  480.           0070 .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 
  481.  
  482.                             DEFAULT VALUES
  483.  
  484. In the event that all of the data stored within the NAM becomes
  485. corrupt, the technician will need to program the security code,
  486. the ESN, and certain default data values to allow the phone to power
  487. up.  Once powered up, all of the other data can be automatically
  488. reconstructed by the phone using the handset programming mode.
  489.  
  490. Since the factory does not provide any information about the
  491. contents of the 8572 EEPROM, we are unsure of the function of
  492. this 'default data.'  It seems to have little significance.
  493.  
  494. The underlined bytes depicted below are fairly typical.  Ideally
  495. the technician should compare the contents of an operational
  496. phone with equivalent firmware to determine the values for the
  497. underlined locations, but if this is not possible then the values
  498. provided in the example may suffice.
  499.  
  500. Once these defaults have been programmed in the proper locations,
  501. and the ESN and security code have been reconstructed, compute
  502. the checksum and store it in address 3D. Temporarily reassemble the
  503. phone and apply power.  The unit should power up and complete it's
  504. self-test which will include the operation where the microprocessor
  505. computes the NAM checksum and compares it to the value stored in
  506. location 3D.
  507.  
  508. Assuming the self-diagnostics pass, the remaining data can now be
  509. reconstructed through normal handset programming.
  510.  
  511. The handset programming template applicable to most of these
  512. units is located immediately following the appendix detailing the chip
  513. programming software included for reference purposes.  
  514.  
  515.  
  516.                         DEFAULT DATA VALUES
  517.  
  518.           0000 XX XX XX XX XX XX XX XX XX 38 XX XX XX XX XX XX
  519.           0010 00 00 00 00 XX XX XX XX XX XX XX XX XX XX XX XX
  520.           0020 XX XX XX XX XX XX XX 00 27 00 01 01 11 11 11 11
  521.           0030 11 08 4D 01 0F 01 0F 00 04 00 00 00 FF XX AA 55
  522.           0040 AA 55 AA 55 AA 55 AA 55 AA 55 AA 55 AA 55 AA 55
  523.           0050 AA 55 AA 55 AA 55 AA 55 AA 55 AA 55 AA 55 AA 55
  524.           0060 AA 55 AA 55 AA 55 AA 55 AA 55 AA 55 AA 55 AA 55
  525.           0070 AA 55 AA 55 AA 55 AA 55 AA 55 AA 55 AA 55 AA 55 
  526.  
  527.                          ADDITIONAL NOTES
  528.  
  529. As discussed, the parallel port programming software interface
  530. has a few quirks, most involving the programming voltage supplied to
  531. the chip.  If all else fails, and a PROM burner is not available,
  532. take the supply voltage (Vcc) directly from the logic board.
  533.  
  534. Run test lead jumpers from pins #4 and #8 of the IC socket on the
  535. logic board that held the 8572 EEPROM and connect to the
  536. respective pins on the socket attached to the cable to be used for
  537. programming.  Turn the board over and locate surface mount
  538. transistor Q115 which switches the supply voltage to the IC
  539. socket on and off.
  540.  
  541. This small chip transistor is directly to the left of pin #8 (of
  542. the 8572 socket) and can be positively identified by the circuit
  543. trace from socket pin #8 leading directly to the emitter of Q115.
  544.  
  545. By examining this area of the board, you can determine which of
  546. the other two traces connects to the transistor's collector. 
  547. Jumpering the traces and shorting the collector and emitter simply
  548. provides a constant, conditioned voltage supply to the socket designed to
  549. power the 8572 in programming mode.  It may also be necessary to cut the
  550. trace to the base of Q115.
  551.  
  552. Once the chip has been programmed with the software, restore the
  553. integrity of the cut trace to the base of Q115 and remove the
  554. short between the collector and emitter.
  555.  
  556.                          USING THE SOFTWARE
  557.  
  558. The Cellular Data Repair Utility software requires that you first
  559. create a small text file using an ASCII text editor such as DOS's
  560. "EDIT" utility program.
  561.  
  562. This text file must contain the data described below in the
  563. specific order presented.  The data in this image (.img) file
  564. will be programmed into the 8572.
  565.  
  566. XXX       ESN Prefix (decimal)
  567. XXXXXXXX  ESN (8 digits decimal)
  568. XXXXX     SIDH (5 digits decimal)
  569. 1         Access Bit
  570. 1         Local Option Bit
  571. AAAPPPXXXX       MIN (10 digits)
  572. 08        SCM
  573. 0XXX      (0333 or 0334)
  574. 10        Access Overload Class
  575. 1         Pref. System Bit
  576. 10        GIM
  577. 12345     Security Code
  578.  
  579.  
  580. EXAMPLE IMAGE FILE
  581. Filename:  TEST.IMG
  582.  
  583. 165
  584. 00246812
  585. 00031
  586. 1
  587. 1
  588. 5105551212
  589. 08
  590. 0334
  591. 10
  592. 1
  593. 10
  594. 12345
  595.  
  596.  
  597.                               PROGRAMMING
  598.  
  599. Once the image file containing the appropriate data has been
  600. saved, run the software with QBASIC or Microsoft BASIC and follow the
  601. prompts.  Be sure to set the proper parallel port address in line
  602. 1950 to reflect the port to which the interface is connected
  603. first.
  604.  
  605.                              TUNING STEPS
  606.  
  607. 1)   With a digital voltmeter attached to the positive terminal
  608. of C908, adjust VR908 to provide a reading of 8 vdc (q 0.1 volt).
  609.  
  610. 2)   With the voltmeter attached to the positive terminal of
  611. C913, adjust VR918 for a reading of 8 vdc (q 0.1 volt).
  612.  
  613. 3)   Connect the voltmeter to test point TXV and enter diagnostic
  614. command 0, 1, SEL, 9, END.  Adjust C676 to achieve a reading of 5
  615. vdc control voltage (q 0.1 volt).
  616.  
  617. 4)   Check receiver control voltage with test point RXV.  Adjust
  618. C614 for a reading of 4 vdc (q 0.1 volt).
  619.  
  620. 5)   With  a power meter connected to the antenna connector of
  621. the transceiver through an attenuator, enter command SEL, 1, 2, SND,
  622. END to turn on the transmitter at high power.  VR814 should then
  623. be adjusted to show 3 watts (34.8 dBm) on the power meter.
  624.  
  625. 6)   Using the same power meter, enter command SEL, 1, 3, 7, END.
  626.  
  627. Adjust VR846 for a low power maximum reading of 4 milliwatts (6
  628. dBm).
  629.  
  630. 7)   Using a frequency counter to measure the output of the
  631. antenna connector, adjust X600 for a reading of 836.4000 MHz (q 0.1 kHz).
  632.  
  633. 8)   Using a deviation meter, activate DTMF tones with command
  634. SEL, 2, 1, END, 1, 1, END and adjust VR259 for 8.4 kHz q 0.1 kHz DTMF
  635. deviation.
  636.  
  637. 9)   End DTMF signaling with command 1, 0, END.  Enable SAT
  638. transmission by entering SEL, 2, 8, SND, END and adjust VR261 for
  639. 7.8 kHz deviation (q 0.1 kHz).
  640.  
  641. 10)  Enter SND, END to discontinue SAT signaling.
  642.  
  643.  
  644.                         ADDITIONAL ADJUSTMENT
  645.  
  646. The level of audio fed to the earphone via the "ear" line (pin #7
  647. on the handset connector) can be adjusted via VR215.  1.2 Vrms is
  648. the factory specified level with the volume turned up to it's
  649. maximum setting.
  650.  
  651. Received audio signals can be adjusted for minimal distortion by
  652. peaking L703.
  653.  
  654. Frequency deviation of voice audio can be fine tuned with VR260. 
  655. Factory spec. is for 8 kHz deviation.
  656.  
  657.  
  658.      POWER LOSS
  659.  
  660. If the transceiver refuses to even power up and begin self-diagnostics,
  661. check the traces on the underside of the board near the power connector.
  662.  
  663. Most of these units 'protect' themselves against reverse polarity
  664. being present on the power cables with fusible traces.  If the
  665. phone is connected to a vehicle or battery power supply backwards,
  666. one of these very small circuit traces will vaporize, leaving the
  667. phone inoperative.
  668.  
  669. While inconvenient for the customer and service technician alike,
  670. repairing the trace is an additional source of revenue for the
  671. shop that might not be generated had a standard replaceable fuse or
  672. rectifier been utilized in the design.
  673.  
  674.  
  675.                              APPENDIX III
  676.  
  677.                          TECHNICAL RESOURCES
  678.  
  679.  
  680.  
  681.      EEPROM PROGRAMMER
  682.  
  683. In preparing this article and performing other research involving various
  684. types of firmware, we used the EPROM+ programming system from Andromeda
  685. Research.  This small, portable device is housed in a carrying case and
  686. requires no internal card to operate with your PC.  Once the software is
  687. installed on the computer, the EPROM+ programmer is simply plugged into an
  688. available parallel printer port.
  689.  
  690. To program the PCD8572 series EEPROMs, a small adapter is required.
  691.  
  692. You can construct this yourself from the included instructions,
  693. or purchase it already built for about $35 extra.
  694.  
  695. The EPROM+ programming system is available for $289 from the
  696. manufacturer:
  697.  
  698.      Andromeda Research
  699.      P.O. Box 222
  700.      Milford, Ohio 45150
  701.      (513) 831-9708 - voice
  702.      (513) 831-7562 - fax
  703.  
  704.  
  705.      SERVICE MANUALS
  706.  
  707. Service manuals are available for most Radio Shack or Tandy products from
  708. Tandy National Parts.  Ordering these publications requires that you visit
  709. your local Radio Shack store.  Tell the clerk that you want him (or her)
  710. to call National Parts and order a service manual for catalog number....
  711.  
  712. National Parts no longer accepts calls from consumers and will only
  713. ship to a recognized Radio Shack retail outlet.
  714.  
  715.      NOKIA - MOBIRA
  716.  
  717. Service handsets, manuals and other parts can be ordered from
  718. Nokia-Mobira in Largo, Florida.  Their toll-free technical
  719. assistance number is (800) 666-5553.
  720.  
  721.      TANDY FAX-BACK SERVICE
  722.  
  723. Tandy Support Services offers technical information via fax-back
  724. server.  There is no mention that the service is restricted to
  725. Radio Shack stores.  Although ANI can be hell, the toll-free number
  726. is (800) 323-6586 if you want to be faxed product info on assorted 'Shack
  727. products.  The server makes neat video game noises, and thanks you for
  728. using the service.
  729.  
  730. For an index of the cellular specification sheets available via
  731. fax-back, request document #8882.
  732.  
  733. Programming instructions are also available from this automated
  734. fax server:
  735.  
  736. DOCUMENT #     PHONE MODEL
  737.  
  738. 9009           Current List [index] 
  739. 8728           CT-105, 1050, 1055
  740. 9004           CT-350
  741. 9005           CT-302
  742. 9006           CT-102, 103, 104, 1030, 1033
  743. 9007           CT-300, 301
  744. 9008           CT-100, 101, 200, 201
  745. 9020           CT-351
  746. 9665           BC901ST         [170-1015]
  747. 9579           CP-1700         [170-1016]
  748. 9577           CP-4600/5600    [170-1067 / 170-1056]
  749. 14493          Ericsson AH-210 [170-1064]
  750. 9581           EZ-400          [170-1057]
  751. 9743           Motorola 12822  [170-1058]
  752. 9583           Motorola DPC550 [170-1059]
  753.  
  754. This information provided for reference purposes only.  Use of
  755. this fax-back service may be restricted to authorized personnel.  No
  756. one has ever faxed me to complain, however. 
  757.  
  758.                        THE INTERFACE
  759.  
  760. The uuencoded drawing which accompanies this article describes the
  761. interface required to use the programming software to rebuild the data
  762. stored within the serial EEPROM.  Because there are a number of variables
  763. that can affect the performance of this software and interface, prepare
  764. yourself for a bit of trial and error.  A standard programming device is
  765. recommended over the use of this software.  Since the original publication
  766. of this manual in hard-copy, we've heard reports that the software does not
  767. work well with the PCD8572, but does favor the PCD85C72 (CMOS version).
  768.  
  769. The DB-25 connector is wired to an 8-pin DIP socket to accommodate the 8572
  770. integrated circuit.  A regulated, well-filtered source of 5 volts must be
  771. connected to pin #8 of the DIP socket, and Pin #4 must be tied to ground.
  772. If the PC used for programming and the power source to the IC socket share
  773. a common ground, you may be able to use pin #25 of the parallel port connector
  774. as shown in the diagram.
  775.  
  776. Please be careful not to cause any shorts in this instance or you
  777. may damage your computer by sinking too much current through the
  778. parallel port.  If you are unsure of what you are doing, eliminate
  779. the connection between pin #4 of the IC socket and pin #25 of the
  780. DB-25 connector.  Instead, connect pin #4 directly to ground.
  781.  
  782. The resistor shown in the circuit is used as an optional voltage
  783. divider.  Depending on the voltage provided by pin #2 of your
  784. parallel port, a resistor between 100 and 1k ohms may be required
  785. to drop it to a level within the nominal range required by the
  786. EEPROM. 
  787.  
  788.                        TUNING THE RADIO
  789.  
  790. The diagrams in the uuencoded .zip file will assist in identifying and
  791. locating the various adjustment points on the logic board and transceiver (RF)
  792. PC board.  Alignment should not be attempted by technicians unfamiliar with
  793. the principles involved, or in the absence of calibrated radio frequency
  794. measurement equipment.
  795.  
  796. A diagnostic (service) handset may be required to access
  797. service-level commands within the transceiver.  If the phone does
  798. not respond properly to the commands documented herein, you'll
  799. need to obtain a service handset from Tandy National Parts.  This
  800. handset is actually a Nokia "programming handset" which can be
  801. obtained directly from the factory.
  802.  
  803.                        PROGRAMMING TEMPLATE
  804.  
  805.           For Tandy / Radio Shack Cellular Mobile Telephones
  806.                  Models CT-102, 302, 1030, 1033, etc.
  807.  
  808.  
  809.  
  810. 1)   Power up phone.  After the phone cycles through it's
  811. self-test mode and the display clears, enter the following keystrokes from
  812. the keypad:
  813.  
  814.      *, 3, 0, 0, 1, #, X, X, X, X, X, SEL, 9, END
  815.  
  816. The X, X, X, X, X represents the five-digit security code stored
  817. in EEPROM.  The factory default is 1, 2, 3, 4, 5.  This security
  818. code is required to access handset programming mode.
  819.  
  820. 2)   The display will now read:    IdEnt IF InFO Pri
  821.  
  822. 3)   Press END to program NAM 1.  Display will show first
  823. programming step.
  824.  
  825. 4)   To program NAM 2, press SND twice instead of END.  Display
  826. will cycle through:       OPt InFO diSAbLEd  then OPt InFO EnAbLEd
  827.      
  828. 5)   Use the END key to step through each step.  The SND key
  829. toggles the state of single-digit options.  To enter new
  830. information, use END to step through the display until the old
  831. data is displayed.  Key in the new data and press END to increment to
  832. the next step.
  833.  
  834. 6)   When programming has been completed, press SEL, CLR to save
  835. changes.
  836.  
  837.  
  838. Step #    Desired Input  Display   Data Description
  839.  
  840. 01        5 digits       HO-Id     SIDH (Home System Identification)
  841. 02        0 or 1         MIN Mark  MIN Mark (Toggle with SND)
  842. 03        0 or 1         LOCL OPt  Local Use Mark (Toggle with SND)
  843. 04        10 digits      Phon      MIN (Area Code + Mobile Number)
  844. 05        08             St CLASS  SCM (Station Class Mark)
  845. 06        333 or 334     PAging Ch IPCH (Initial Paging Channel)
  846. 07        2 digits       O-LOAd CL Access Overload Class
  847. 08        A or B         PrEF SyS  Preferred System (Toggle with SND)
  848. 09        2 digits       grOUP Id  GIM Mark (Set to 10 in U.S.)
  849. 10        5 digits       SECUrity  Security Code
  850. 11        -------        1 dAtE    Firmware Date - not changeable
  851. 12        mmddyy         2 dAtE    Installation Date
  852.  
  853. Press SEL, CLR to save & exit.  Turn Power off and back on for
  854. model CT-302.
  855.  
  856.  
  857. [Begin Editorial]
  858.  
  859. --------------------------------------------------------------------------
  860. HOW TO OBTAIN A HARD-COPY VERSION OF THIS FILE - WITH ALL PHOTOS:
  861. --------------------------------------------------------------------------
  862.  
  863. "The Complete Guide to Tandy / Radio Shack Cellular Hardware" is available
  864. for $15 prepaid.  We keep $5 of the price to cover the cost of printing
  865. and the Priority mail postage.  The remaining $10 of the purchase price will
  866. be donated to Boston's The L0pht to help them cover the cost of upgrading
  867. their Internet connection for l0pht.com....
  868.  
  869. The guys at the L0pht have always been cool with us, and maintain what
  870. amounts to one of the best cellular archives accessible on the 'net.  We
  871. want to do what we can to assist them in providing this public source of
  872. enlightenment.  Now you can help them, and get something for it in return.
  873. If nothing else, you can sit back and enjoy all my great close-up photos
  874. of the chips <g>!
  875.  
  876.                                             -- Damien Thorn
  877.  
  878. Here's the address:
  879.  
  880. Phoenix Rising Communications
  881. 3422 W. Hammer Lane, Suite C-110
  882. Stockton, California 95219
  883.  
  884. [end editorial]
  885.  
  886. -----------------------------------------------------------------------------
  887. You can reach me via e-mail at:  damien@prcomm.com
  888. -----------------------------------------------------------------------------
  889.  
  890.  
  891.  
  892. 1000 ' CELLULAR DATA REPAIR UTILITY
  893. 1005 ' Form image and program PCD8572 IC via LPT port.
  894. 1010 ' (c) 1993, 1994, 1995 WarpCoreBreachGroup - All rights reserved.
  895. 1015 ' 
  896. 1020 ' This program is not shareware/freeware.
  897. 1025 '
  898. 1030 DATA xx,xx,xx,xx,xx,xx,xx,xx ' Bytes 00-07
  899. 1040 DATA xx,38,xx,xx,xx,xx,xx,xx ' Bytes 08-15
  900. 1050 DATA 00,00,00,00,xx,xx,xx,xx ' Bytes 16-23
  901. 1060 DATA xx,xx,xx,xx,xx,xx,xx,xx ' Bytes 24-31
  902. 1070 DATA xx,xx,xx,D6,C5,5C,C6,00 ' Bytes 32-39
  903. 1080 DATA 27,00,01,01,11,11,11,11 ' Bytes 40-47
  904. 1090 DATA 11,08,4D,01,0F,01,0F,00 ' Bytes 48-55
  905. 1100 DATA 04,00,00,00,FF          ' Bytes 56-60
  906. 1105 UNIT1$="050490"
  907. 1110 DIM BYTE$(60),BYTE(61)
  908. 1120 FOR I=0 TO 60:READ BYTE$(I):NEXT
  909. 1130 FILES "*.IMG"
  910. 1140 LINE INPUT "Which file do you want to read? ";F$
  911. 1150 OPEN "I",#1,F$+".IMG"
  912. 1160 INPUT#1,ESNPREFIX
  913. 1170 INPUT#1,ESN#
  914. 1180 INPUT#1,HOMEID
  915. 1190 INPUT#1,ACCESS
  916. 1200 INPUT#1,LOCALOPT
  917. 1210 INPUT#1,PHONE$
  918. 1220 INPUT#1,STATCLASS
  919. 1230 INPUT#1,PGCH
  920. 1240 INPUT#1,OVERLDCL
  921. 1250 INPUT#1,PREFSYS
  922. 1260 INPUT#1,GROUPID
  923. 1270 INPUT#1,SEC$
  924. 1280 ' Building binary image
  925. 1290 UNIT2$=MID$(UNIT$,1,2)+MID$(UNIT$,4,2)+MID$(UNIT$,9,2)
  926. 1300 CLOSE #1
  927. 1310 FOR I=1 TO 5:BYTE$(I-1)="3"+MID$(SEC$,I,1):NEXT
  928. 1320 FOR I=0 TO 2:BYTE$(10+I)=RIGHT$("0"+HEX$(VAL(MID$(UNIT1$,I*2+1,2))),2)
  929. 1325 NEXT
  930. 1330 FOR I=0 TO 2:BYTE$(13+I)=RIGHT$("0"+HEX$(VAL(MID$(UNIT2$,I*2+1,2))),2)
  931. 1335 NEXT
  932. 1340 FOR I=0 TO 4:BYTE$(24+I)=MID$(PHONE$,2*I+1,2):NEXT
  933. 1350 FOR I=5 TO 0 STEP -1
  934. 1360 Q=INT(ESN#/(16^I))
  935. 1370 ESN#=ESN#-Q*(16^I)
  936. 1380 IF Q>9 THEN Q=Q+7
  937. 1390 ESN$=ESN$+CHR$(48+Q)
  938. 1400 NEXT
  939. 1410 BYTE$(8)=RIGHT$("0"+HEX$(ESNPREFIX),2)
  940. 1420 BYTE$(5)=MID$(ESN$,5,2)
  941. 1430 BYTE$(6)=MID$(ESN$,3,2)
  942. 1440 BYTE$(7)=MID$(ESN$,1,2)
  943. 1450 FOR I=0 TO 60:Q$=BYTE$(I)
  944. 1460 QH=ASC(LEFT$(Q$,1))-48:IF QH>9 THEN QH=QH-7:IF QH>15 THEN QH=QH-32
  945. 1470 QL=ASC(RIGHT$(Q$,1))-48:IF QL>9 THEN QL=QL-7:IF QL>15 THEN QL=QL-32
  946. 1480 Q=QH*16+QL
  947. 1490 BYTE(I)=Q:CHECK=CHECK+Q
  948. 1500 NEXT
  949. 1510 BYTE(20)=HOMEID AND 255:BYTE(21)=INT(HOMEID/256)
  950. 1520 BYTE(22)=ACCESS
  951. 1530 BYTE(23)=LOCALOPT
  952. 1540 BYTE(29)=STATCLASS
  953. 1550 BYTE(30)=PGCH AND 255:BYTE(31)=INT(PGCH/256)
  954. 1560 BYTE(32)=OVERLDCL
  955. 1570 BYTE(33)=PREFSYS
  956. 1580 BYTE(34)=GROUPID
  957. 1590 AC$=MID$(PHONE$,1,3)
  958. 1600 PRE$=MID$(PHONE$,4,3)
  959. 1610 PH$=MID$(PHONE$,7,4)
  960. 1620 AC=VAL(AC$)
  961. 1630 IF MID$(AC$,2,2)="00" THEN AC2=AC-1:GOTO 1670
  962. 1640 IF MID$(AC$,3,1)="0" THEN AC2=AC-101:GOTO 1670
  963. 1650 IF MID$(AC$,2,1)="0" THEN AC2=AC-11:GOTO 1670
  964. 1660 AC2=AC-111
  965. 1670 PRE=VAL(PRE$)
  966. 1680 IF MID$(PRE$,2,2)="00" THEN PRE2=PRE-1:GOTO 1720
  967. 1690 IF MID$(PRE$,2,1)="0" THEN PRE2=PRE-11:GOTO 1720
  968. 1700 IF MID$(PRE$,3,1)="0" THEN PRE2=PRE-101:GOTO 1720
  969. 1710 PRE2=PRE-111
  970. 1720 IF PRE2<0 THEN PRE2=1000+PRE2
  971. 1730 IF LEFT$(PH$,1)="0" THEN D=-24:GOTO 1750
  972. 1740 D=87-24*(ASC(PH$)-49)
  973. 1750 IF MID$(PH$,4,1)="0" THEN D=D-10
  974. 1760 IF MID$(PH$,3,1)="0" THEN D=D-100
  975. 1770 IF MID$(PH$,2,1)="0" THEN D=D-1000
  976. 1780 IF MID$(PH$,1,1)="0" THEN D=D-10105
  977. 1790 PH2=VAL(PH$)-D
  978. 1800 C=INT(PRE2/4)
  979. 1810 B=64*(PRE2 AND 3)
  980. 1820 A=PH2 AND 255
  981. 1830 B=B OR INT(PH2/256)
  982. 1840 BYTE(35)=A
  983. 1850 BYTE(36)=B
  984. 1860 BYTE(37)=C
  985. 1870 BYTE(38)=AC2 AND 255
  986. 1880 BYTE(39)=INT(AC2/256)
  987. 1890 CHECK=0
  988. 1900 FOR I=0 TO 60
  989. 1910 CHECK=CHECK+BYTE(I)
  990. 1920 NEXT
  991. 1930 BYTE(61)=CHECK AND 255
  992. 1940 DEV$="1010":ADDR$="000"
  993. 1945 ' Select the base address for your printer port with the next line.
  994. 1950 BASE=&H378 ' Which is LPT2. &h378 is LPT1 and &h3bc is LPT3.
  995. 1960 GOTO 2120
  996. 1970 OUT BASE,(DOUT AND 1) OR 2*(CLK AND 1) OR 4*(RELAY)
  997. 1980 FOR DELAY=0 TO 9:NEXT
  998. 1990 DIN=INP(BASE) AND 1
  999. 2000 RETURN
  1000. 2010 FOR I=1 TO LEN(B$)
  1001. 2020 B=ASC(MID$(B$,I,1))-48
  1002. 2030 DOUT=B:CLK=0:GOSUB 1970
  1003. 2040 DOUT=B:CLK=1:GOSUB 1970
  1004. 2050 DOUT=B:CLK=0:GOSUB 1970
  1005. 2060 NEXT
  1006. 2070 T=0
  1007. 2080 DOUT=1:CLK=1:GOSUB 1970
  1008. 2090 IF DIN=0 THEN RETURN
  1009. 2100 IF T=200 THEN BEEP:PRINT "Nack timeout error":STOP
  1010. 2105 ' Is voltage applied to the chip?
  1011. 2110 T=T+1:GOTO 2080
  1012. 2120 MAX=61:RELAY=1:DOUT=1:CLK=1:GOSUB 1970
  1013. 2130 T$=TIME$
  1014. 2140 IF T$=TIME$ GOTO 2140
  1015. 2150 FOR J=0 TO MAX
  1016. 2160 DOUT=1:CLK=1:GOSUB 1970 ' Start bit
  1017. 2170 IF DIN=0 THEN BEEP:PRINT "Bus not free error":STOP ' Bad!
  1018. 2180 DOUT=0:CLK=1:GOSUB 1970
  1019. 2190 DOUT=0:CLK=0:GOSUB 1970
  1020. 2200 B$=DEV$+ADDR$+"0"
  1021. 2210 GOSUB 2010
  1022. 2220 B$=""
  1023. 2230 FOR I=7 TO 0 STEP -1
  1024. 2240 IF (J AND (2^I)) THEN B$=B$+"1" ELSE B$=B$+"0"
  1025. 2250 NEXT
  1026. 2260 GOSUB 2010
  1027. 2270 Z=BYTE(J)
  1028. 2280 B$="":FOR I=7 TO 0 STEP -1
  1029. 2290 IF (Z AND (2^I)) THEN B$=B$+"1" ELSE B$=B$+"0"
  1030. 2300 NEXT
  1031. 2310 GOSUB 2010
  1032. 2320 DOUT=0:CLK=0:GOSUB 1970
  1033. 2330 DOUT=0:CLK=1:GOSUB 1970 ' Stop bit
  1034. 2340 DOUT=1:CLK=1:GOSUB 1970
  1035. 2350 PRINT USING "###% programmed";100*J/MAX
  1036. 2360 PRINT STRING$(80*J/MAX,46)
  1037. 2370 LOCATE CSRLIN-2,POS(0)
  1038. 2380 GOSUB 1970
  1039. 2390 IF DIN=0 GOTO 2380
  1040. 2400 NEXT
  1041. 2410 RELAY=0:DOUT=1:CLK=1:GOSUB 1970
  1042. 2420 PRINT:PRINT
  1043. 2430 'This is the end in case you though the code was truncated somehow...
  1044.  
  1045.  
  1046.