main page |
Jukebox notesException vectorsThe first 0x200 bytes of the image appears to be the exception vector table. The vectors are explained on pages 54 and 70-71 in the SH-1 Hardware Manual, Here's the vector table for v5.03a:
From the use of address 0x0903f2bc as stack pointer, we can deduce that the DRAM is located at address 0x09000000. This is backed by the HW manual p102, which says that DRAM can only be at put on CS1, which is either 0x01000000 (8-bit) or 0x09000000 (16-bit). The vector table also corresponds with the fact that there is code at address 0x200 of the image file. 0x200 is thus the starting point for all code. Port pins
Port C pin function configuration summary:
LabelsNote: Everything is about v5.03a.
SetupThe startup code at 0x200 (0x09000200) naturally begins with setting up the system. Vector Base RegisterThe first thing the code does is setting the VBR, Vector Base Register, and thus move the exception vector table from the internal ROM at address 0 to the DRAM at address 0x09000000: 0x00000200: mov.l @(0x02C,pc),r1 ; 0x0000022C (0x09000000) 0x00000202: ldc r1,vbr StackThe next instruction loads r15 with the contents of 0x228, which is 0x0903f2bc. This is the stack pointer, which is used all over the code. 0x00000204: mov.l @(0x024,pc),r15 ; 0x00000228 (0x0903F2BC) After that the code jumps to the hardware setup at 0xc8c0. 0x00000206: mov.l @(0x01C,pc),r0 ; 0x00000220 (0x0900C8C0) 0x00000208: jsr @r0 DRAM controllerFirst up is DRAM setup, at 0xc8c8. It sets the memory controller registers: 0x0000C8C8: mov.l @(0x068,pc),r2 ; 0x0000C930 (0x05FFFFA8) 0x0000C8CA: mov.w @(0x05A,pc),r1 ; 0x0000C924 (0x1E00) 0x0000C8CC: mov.l @(0x068,pc),r7 ; 0x0000C934 (0x0F0001C0) 0x0000C8CE: mov.w r1,@r2 ; 0x1e00 -> DCR 0x0000C8D0: mov.l @(0x068,pc),r2 ; 0x0000C938 (0x05FFFFAC) 0x0000C8D2: mov.w @(0x054,pc),r1 ; 0x0000C926 (0x5AB0) 0x0000C8D4: mov.w r1,@r2 ; 0x5ab0 -> RCR 0x0000C8D6: mov.l @(0x068,pc),r2 ; 0x0000C93C (0x05FFFFB2) 0x0000C8D8: mov.w @(0x050,pc),r1 ; 0x0000C928 (0x9605) 0x0000C8DA: mov.w r1,@r2 ; 0x9505 -> RTCOR 0x0000C8DC: mov.l @(0x064,pc),r2 ; 0x0000C940 (0x05FFFFAE) 0x0000C8DE: mov.w @(0x04C,pc),r1 ; 0x0000C92A (0xA518) 0x0000C8E0: mov.w r1,@r2 ; 0xa518 -> RTCSR Serial port 0Code starting at 0x483c. As C code:
Serial port 1Code starting at 0x47a0. As C code:
Pin configurationStarting at 0xc40a: CASCR = 0xafff: Column Address Strobe Pin Control Register. Set bits CASH MD1 and CASL MD1. Port APACR1 = 0x0102: Set pin functions PACR2 = 0xbb98: Set pin functions PAIOR &= 0xfffe: PA0 is input PAIOR &= 0xffdf: PA5 is input PADR &= 0xff7f: Set pin PA7 low PAIOR |= 0x80: PA7 is output PAIOR |= 0x100: PA8 is output PADR |= 0x200: Set pin PA9 high PAIOR |= 0x200: PA9 is output PAIOR |= 0x400: PA10 is output PAIOR &= 0xf7ff: PA11 is input PAIOR &= 0xbfff: PA14 is input PAIOR = 0x7fff: PA15 is input PADR &= 0xfeff: Set pin PA8 low Port BPBCR1 = 0x12a8: Set pin functions PBCR2 = 0x0000: Set pin functions PBDR &= 0xffef: Set pin PB4 low PBIOR &= 0xffef: PB4 is input PBIOR |= 0x20: PB5 is output PBIOR |= 0x40: PA6 is output PBDR &= 0xffbf: Set pin PB6 low PBDR |= 0x20: Set pin PB5 high ITU (Integrated Timer Pulse Unit)Starting at 0xfcd0: TSNC &= 0xfe: The timer counter for channel 0 (TCNT0) operates independently of other channels
Memory area #6 ?From 0xc52a: PADR |= 0x0200: Set PA13 high
Remote controlTjerk Schuringa reports: "Finally got that extra bit going on my bitpattern generator. So far I fed only simple characters to my jukebox, and this is the result: START D0 1 2 3 4 5 6 7 STOP FUNCTION 0 0 0 0 0 0 1 1 1 1 VOL- (the one I got already) 0 0 0 0 1 0 1 1 VOL+ (figures) 0 0 0 1 0 0 1 1 + 0 0 1 0 0 0 1 1 - 0 1 0 0 0 0 1 1 STOP 1 0 0 0 0 0 1 1 PLAY I also found that "repeat" functions (keep a button depressed) needs to be faster than 0.5 s. If it is around 1 second or more it is interpreted as a seperate keypress. So far I did not get the "fast forward" function because the fastest I can get is 0.5 s. Very important: the baudrate is indeed 9600 baud! These pulses are fed to the second ring on the headphone jack, and (if I understood correctly) go to RxD1 of the SH1." LCD displayThe Recorder uses a Shing Yih Technology G112064-30 graphic LCD display with 112x64 pixels. The controller is a Solomon SSD1815Z. It's not yet known what display/controller the Jukebox has, but I'd be surprised if it doesn't use a similar controller. Starting at 0xE050, the code flicks PB2 and PB3 a great deal and then some with PB1 and PB0. Which gives us the following connections:
The Recorder apparently has the connections this way (according to Gary Czvitkovicz):
The player charsets:
And the Recorder charset looks like this:
CodeThis C snippet write a byte to the Jukebox LCD controller. The 'data' flag inticates if the byte is a command byte or a data byte.
Firmware sizeJoachim Schiffer found out that firmware files have to be at least 51200 bytes to be loaded by newer firmware ROMs. So my "first program" only works on players with older firmware in ROM (my has 3.18). Joachim posted a padded version that works everywhere. Tests have shown that firmware sizes above 200K won't load. Page was last modified "Aug 7 2002" Björn Stenberg |