Replacing the MM5799 with a PIC

738 views
Skip to first unread message

golde...@yahoo.fr

unread,
Oct 6, 2011, 5:49:30 AM10/6/11
to rockola477
MM5799 Logic board replacement

This project is to replace the MM5799 from the logic board with a
modern and reprogrammable microcontroller the PIC 16F877 installed on
a small PCB plugged on the MM5799 socket

Basically the MM5799 is a pretty much basic microcontroller using 11
input signals and 8 output signals . All the logic signal use 9V
swing.

Depending of the extension letter the program written in the chip is
different

NAX/N for LOGIC BOARD,
NFT/N for the HIT TRACKER

It is probably a one time programmable device produced with the code
written in it

The Logic Board use the following signals

IN Signal name OUT Signal name
1 A-B 8 Function In
2 Play 9 Data Clock
3 Home Sw 14 Data Enable
4 Encode 16 Data Out
5 Wall box 18 Money Counter
10 DATA IN 19 Stop
11 Clear 20 Run
12 160 Sel Strap 28 IOK
24 Load Mem Sw
26 Scan
27 Test Sw


Hardware considerations

We could design a small pcb plugable on the MM5799 socket having a
16F877 interfaced with level changer components to the input/output
signal of the Logic board.
The PIC 16F877 has four 8 bits I/O ports with a swing of 5v. The input
signal from the Logic Board can be made compatible with TTL logic just
with TTL buffer chips, the output signal with CMOS buffer using 9V
supply. We also need a 5V supply, a 7805 from the 9.6V is ok. No need
special clock just the PIC internal one

Software considerations

Part of the code produced by Jim could be reused, this is the code
handling the mechanism.
Jim indicates that his machine does not have a credit unit, he had to
control the display and keyboard with its program.
In my project I want to keep using the Profit Setter and Hit Tracker
modules which are interfaced to the “Logic Board” thru the signals
data line & clock.

We have to write the code to handle the data coming back and forth
from the different modules. Understanding the protocol is the main
difficulty

To simplify the writing of the code I suggest to write it in “C”
language, pretty much easier to debug using the “In Circuit Debugger”
ICD2 from Microchip

Jim Hawkridge

unread,
Oct 6, 2011, 6:42:24 AM10/6/11
to rocko...@googlegroups.com
Hi, 

This sounds like an interesting project. I think the tricky part, as you say, is figuring out what needs to be sent on that data bus.

My box did have a "profit setter" board but it appeared that one of the MM chips on there was dead. I did consider trying to replace it as you describe but I didn't have any tools suitable for figuring out what I needed to send on the data bus. I also figured that if one MM chip went then the others might follow shortly after so I might as well get rid of all of them in one go. 

Cheers,
Jim


--
You received this message because you are subscribed to the Google Groups "rockola477" group.
To post to this group, send email to rocko...@googlegroups.com.
To unsubscribe from this group, send email to rockola477+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rockola477?hl=en.


Peter Watkins

unread,
Oct 6, 2011, 12:04:26 PM10/6/11
to rocko...@googlegroups.com
Hi,

This is interesting but at the moment my Juke box is still working OK after some early teathing problems. I wish I was a bit more into pics and software, maybe someone will do it for us !!

Peter




========================================
Message Received: Oct 06 2011, 11:42 AM
From: "Jim Hawkridge"
To: rocko...@googlegroups.com
Cc:
Subject: Re: Replacing the MM5799 with a PIC

Andre FLAGOTHIER

unread,
Oct 7, 2011, 4:10:05 AM10/7/11
to rocko...@googlegroups.com

The box I’m working on is a 476, I bough it for couple of bugs a few weeks ago, but nothing works, the power supply is OK, may be the amplifier, I don’t know yet, even the magazine doesn’t turn with the scan switch, but it turn when changing the home switch.

On the logic board the signal RUN stay low even if the signal scan enable  (pin 26) change, for this reason the play relay is not energized and the magazine doesn’t turn. All the conditions to get the run signal ON seem to be OK. The MM chip is surely dead.

 

Designing the replacement of the MM on the logic board is very tricky, I should prefer going in the same direction as you, replacing both in one shot.

I’d like to redesign a new PCB to be installed in the location of the Profit setter board that will reuse the existing connectors for display, keyboard, light indicators and why not the coin validator. The connection to the logic board will be a 28 wires flat cable scrimped on a 28 pins header.

 

To avoid starting from scratch, I’d to have your schematic, to rapidly create an operational PCB with your software I downloaded.

 

If I want to implement some new functionally perhaps the coin validator, I will use the Microchip ICD2 to debug. During the debug, ICD2 uses some pins to communicate with the prototype, most PIC reserve pins RB7 and RB6 to communicate with ICD2, therefore these pins are not available for the application. In your document describing the circuit details all pins from Port B are used for display, moreover in Port C pins 7 & 6 are not used, so I will swap port B and C adapting the software for that change

 

In a second phase may be in the first one I’d like to translate the software in “C” language, much more readable and flexible. Before that, I have to understand the logic of your program as well as the 16F877, I’ve never used.

 

I you agree with me, could you send me the schematics, personnaly I use Eagle software to draw my schematics as well as to create the PCB layout, but even some hand drawing would be usefull.

 

Here is my mail address : andre.fl...@skynet.be

 

Regards

 

    

 


De : rocko...@googlegroups.com [mailto:rocko...@googlegroups.com] De la part de Jim Hawkridge
Envoyé : jeudi 6 octobre 2011 12:42
À : rocko...@googlegroups.com
Objet : Re: Replacing the MM5799 with a PIC

Jim Hawkridge

unread,
Oct 7, 2011, 5:36:51 AM10/7/11
to rocko...@googlegroups.com
Hi, 

I don't have schematics for my design. It was very simple though - the PIC sat in the middle with appropriate level conversion components around it. Most of the components were chosen because they were what I had rather than for any good engineering reason.

I do have a pcb layout but it's in hardcopy and I would need to figure out a way to scan it. I might be able to do this though if you would be interested? I'm not sure how helpful it would be though because there are a few mistakes in the layout that I had to work around. And I used the coin validator header for communication with the logic board because I didn't have a coin validator back then. Communication with the logic board is via the 28 PIN chip socket as you describe. You can just about see it in this picture: http://jim.hawkridges.co.uk/projects/juke/labeled-big.php.

Also, I can try to describe how my code works - although I wrote it in summer 2002 so my memory of it is rather hazy now.

Cheers,
Jim

Andre FLAGOTHIER

unread,
Oct 7, 2011, 11:56:19 AM10/7/11
to rocko...@googlegroups.com

Hi

Many thanks for you cooperation.

 

I will start to draw a preliminary schematic, as soon as it will be done I ‘ll send you for comments

 

About the level changer devices, for signals coming from the logic board we just need TTL buffer with a small resistance due to the fact that the signal are 9v active high.

For the output signals going to the logic board a CMOS buffer with inputs TTL compatible, powered with 9V will be OK, Is it the same for the display signals

For the keyboard as well as the coin validator there is no need to convert level, they are just a switches matrix

 

About the code description I am totally interested with some explanations, because understanding assembler code is quite difficult.

 

As soon as you have the opportunity to scan the layout, I am also interested even if as you say it is not very usefull

 

Thank you for future informations

 

Regards

Andre

 

 


De : rocko...@googlegroups.com [mailto:rocko...@googlegroups.com] De la part de Jim Hawkridge
Envoyé : vendredi 7 octobre 2011 11:37


À : rocko...@googlegroups.com
Objet : Re: Replacing the MM5799 with a PIC

 

Hi, 

--

Jim Hawkridge

unread,
Oct 10, 2011, 9:21:42 AM10/10/11
to rocko...@googlegroups.com
Yes, I have done something like what you describe with TTL to 9v and 9v to TTL.

For the LEDs, I just connect them direct to the PIC. It can handle enough current to power an LED.
The 7 segment VFD displays are multiplexed (as I'm sure you know). I seem to remember that both the digit and segment lines are activated by pulling them to ground. I used a ULN2003 for this (which is a darlington array) but this was because it was what I had to hand.

The code (http://code.google.com/p/rockola477/source/browse/trunk/juke.asm) is commented with some details of what it is doing but I guess it is lacking an overview so I will try to briefly describe it here:
We have to deal with two things simultaneously - (1) control of the mechanism and (2) interaction with the user. We have two variables to keep track of the current state of these two things - (1) mmode: contains the current state of the mechanism and (2) umode: contains the current state of the user interaction. There is an event loop which starts at line 120 and runs to line 507. Each time we go round that loop we update 1 digit of the display and scan 1 row of the keyboard. Signals on one of the logic inputs or from the keyboard can change the umode and mmode variables.

Here are the possible states of each variable:
umode:
0: Idle - nothing is happening. What is displayed depends on if there is credits left and if a record is playing.
1: Credits are available, waiting for first keypress 
2: One valid keypress, waiting for second keypress
3: Two valid keypresses, waiting for third keypress
4: Invalid keypress entered (i.e. first digit is a 3 which is an invalid record number).
5: Three valid keypresses received - there is a short delay here where you can see which record you have selected and can press reset if you want to cancel (in which case you would be sent back to umode=1)
6: Record selected - the record is added to the queue. The display is reset and we return to umode=0.

mmode:
0: The carousel is not at home but we would like it to be. We are waiting for it to get to the home position.
1: The home switch is engaged. The carousel is at the home position.
2: There are songs in the queue. We issue a go signal.
3: Go signal has been issued and the home switch has disengaged. We are waiting for the correct record to come around. We count pulses on the opto encoder and watch the status of the A/B switch. If the home switch engages we jump to mode 1.
4: We have found the record we want. We issue the play signal.
5: This mode is triggered a short time after mode 4. It cancels the play signal.
6: The record is playing.  We monitor the opto to see when it is finished. We then jump to mode 3.

I haven't got time right now to write much more but I hope all this helps somehow. It is nearly ten years since I wrote this so my memory of it is a bit hazy. If I can answer any specific questions then please do ask. 

Jim

Andre FLAGOTHIER

unread,
Oct 10, 2011, 11:55:39 AM10/10/11
to rocko...@googlegroups.com

Thanks for your explanations regarding the software functions

 

Yesterday I started to read it as I had  to arrange the order of the signals at PORTA & PORTB

 

When I described TTL to 9V and 9V to TTL it was something regarding the logic signal from and to the logic board

But finishing my schematic I get stuck with the display signal driver ULN2803 or a similar one ULN2003

 

Basically to display a segment in a VFD you need to have the anode as well as the grid at a positive voltage level with respect to the cathode voltage

 

In the rock-ola display the cathode (filament) is at -21VDC, so grounding the anode and grid will be OK to light the segment

If you connect the output of a ULN2803 to a segment line and you put a true level on the input, the output, a NPN Darlington, will go low near ground level, (active level). What happens if you put a low level at the input, does the segment line return to -21V, may be as the NPN Darlington is open collector ? Surely we cannot put a pull up resistor at the output of the 2803.

 

I cannot figured out how to connect the ULN2803 to the segment and grid signal and where are the pull-up resistors

 

Could you make me a simple draft to see how to connect the ULM2803

 

Regarding the keyboard multiplex, in your document are you saying that the four keyboard signal K1,K2,K3,K4 are connected directly to PORTA pins and not behind the ULN2803

 

 

I’ll send you my schematic as soon as I will fix my PC problems (anti-virus, zan printer …).

If you have Eagle schematic & layout editor  (cadsoft) I can send the “.sch” file instead of converting in ‘.pdf”

 

Andre

 

 


De : rocko...@googlegroups.com [mailto:rocko...@googlegroups.com] De la part de Jim Hawkridge
Envoyé : lundi 10 octobre 2011 15:22

golde...@yahoo.fr

unread,
Oct 15, 2011, 4:23:50 PM10/15/11
to rockola477
I'm very exited with you project.
I just finished to produce a schematic and layout, in next few days,
when I'll have received the components and made some verification
about the level changers, I'll produce the board.
I had to introduce some changes, swapping the PORT B & C in order to
debug the software with the "in circuit debugger 2" from Microchip,
this device needs the RB6 and RB7 to be released in the prototype,
these two signals interfere with the ICD2
As my coin validator is capable to discriminate two different coins
(1€ and 2€) I displaced the signals to PORTB bits 4 & 5
Now PORTC handles the segments signals and PORTB handles the signals
SCAN,HOME, OPTO, A/B, coin1 and coin2

I read attentively your software and I started to rewrite it in "C"
language starting with some of the basic functions.
I don't understand the reason why you set up the UART controller, are
you using this one somewhere or is it just to avoid any interaction
with it.

In my next mail I'll join the schematics to have your comments

Regards
> On 7 October 2011 16:56, Andre FLAGOTHIER <goldenco...@yahoo.fr> wrote:
>
> Hi
>
> Many thanks for you cooperation.
>
> I will start to draw a preliminary schematic, as soon as it will be done I
> ‘ll send you for comments
>
> About the level changer devices, for signals coming from the logic board we
> just need TTL buffer with a small resistance due to the fact that the signal
> are 9v active high.
>
> For the output signals going to the logic board a CMOS buffer with inputs
> TTL compatible, powered with 9V will be OK, Is it the same for the display
> signals
>
> For the keyboard as well as the coin validator there is no need to convert
> level, they are just a switches matrix
>
> About the code description I am totally interested with some explanations,
> because understanding assembler code is quite difficult.
>
> As soon as you have the opportunity to scan the layout, I am also interested
> even if as you say it is not very usefull
>
> Thank you for future informations
>
> Regards
>
> Andre
>
>   _____  
>
> De : rocko...@googlegroups.com [mailto:rocko...@googlegroups.com] De la
> part de Jim Hawkridge
> Envoyé : vendredi 7 octobre 2011 11:37
> À : rocko...@googlegroups.com
> Objet : Re: Replacing the MM5799 with a PIC
>
> Hi,
>
> I don't have schematics for my design. It was very simple though - the PIC
> sat in the middle with appropriate level conversion components around it.
> Most of the components were chosen because they were what I had rather than
> for any good engineering reason.
>
> I do have a pcb layout but it's in hardcopy and I would need to figure out a
> way to scan it. I might be able to do this though if you would be
> interested? I'm not sure how helpful it would be though because there are a
> few mistakes in the layout that I had to work around. And I used the coin
> validator header for communication with the logic board because I didn't
> have a coin validator back then. Communication with the logic board is via
> the 28 PIN chip socket as you describe. You can just about see it in this
> picture:  <http://jim.hawkridges.co.uk/projects/juke/labeled-big.php>http://jim.hawkridges.co.uk/projects/juke/labeled-big.php.
>
> Also, I can try to describe how my code works - although I wrote it in
> summer 2002 so my memory of it is rather hazy now.
>
> Cheers,
>
> Jim
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "rockola477" group.
> To post to this group, send email to rocko...@googlegroups.com.
> To unsubscribe from this group, send email to
> rockola477+...@googlegroups.com
> <mailto:rockola477%2Bunsu...@googlegroups.com> .
> For more options, visit this group athttp://groups.google.com/group/rockola477?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups
> "rockola477" group.
> To post to this group, send email to rocko...@googlegroups.com.
> To unsubscribe from this group, send email to
> rockola477+...@googlegroups.com
> <mailto:rockola477%2Bunsu...@googlegroups.com> .
> For more options, visit this group athttp://groups.google.com/group/rockola477?hl=en.

Jim Hawkridge

unread,
Oct 15, 2011, 4:58:12 PM10/15/11
to rocko...@googlegroups.com
Hello, 

I am glad you are getting on well with this. I haven't had a chance to look at the previous schematic you sent due to illness. I will await your new version.

If you have lost messages then this mailing list is archived on the Google Groups page at http://groups.google.com/group/rockola477/browse_thread/thread/8b9bcab9a89a9497/8f9fe7a87bfa8cb2#8f9fe7a87bfa8cb2

The UART initialisation code is there from when I had the juke set up to be remote controllable from the PC. You could select records from the PC via serial port. This functionality is disabled in the code but the routines are still there.

Regards,
Jim

Andre FLAGOTHIER

unread,
Oct 16, 2011, 5:46:38 AM10/16/11
to rocko...@googlegroups.com

I effectively retreive the mail on the group

Regarding the UART I had the feeling that it was used for the remote control

 

Regards

 

 


De : rocko...@googlegroups.com [mailto:rocko...@googlegroups.com] De la part de Jim Hawkridge
Envoyé : samedi 15 octobre 2011 22:58


À : rocko...@googlegroups.com
Objet : Re: Replacing the MM5799 with a PIC

 

Hello, 

--

MM5799replacement-icd.pdf

Andre FLAGOTHIER

unread,
Oct 20, 2011, 12:08:13 PM10/20/11
to rocko...@googlegroups.com

I started to rewrite the software in « C » language, the result should be a software completly interrupt driven.

 

Basically there are six major events : 1. keyboard key pressed

                                                       2 coin switches

                                                       3 four input from logic board (A/B, SCAN, HOME, OPTO)

 

To sense theses events I use a GAL22V10 to generate an interrupt signal to RB0/INT.

In the ISR procedure we have to discriminate which input created the interrupt and then we serve the event.

 

I join the modified schematic

 

Regards

 

 


De : rocko...@googlegroups.com [mailto:rocko...@googlegroups.com] De la part de Jim Hawkridge
Envoyé : samedi 15 octobre 2011 22:58
À : rocko...@googlegroups.com
Objet : Re: Replacing the MM5799 with a PIC

 

Hello, 

--

MM5799replacement.pdf

Richard Ruddick

unread,
May 7, 2014, 10:23:00 AM5/7/14
to rocko...@googlegroups.com
Hi,

What was the out come of this. Did you manage to get it to work ?

would it be possible to see the software you have written ?

Regards
Richard

Goldenconti

unread,
May 7, 2014, 12:32:44 PM5/7/14
to rocko...@googlegroups.com

Hi

 

Yes I did it for my own 476, it works pretty well and have a special feature, the JB play the disk in the order they were selected not in the magazine order.

To do this I set ip up in freeplay, 20 selections available in a queue, when  a selection is made, the number is pushed in the queue and dequeued for the next record to play, credit counter decrement as you select and increment up to 20 when a new record is played

Last year a guy in France made a copy of the board and that I troubleshooted it

 

About the software :

At the beginning I expected to handle the keyboard by interrupt and it never work properly so I decided to handle it by software, evidently the most difficult problem is the switches debounce without any display flickering   

 

Now the rev2 handles the opto  switch as well the scan switch by software interrupt and the keyboard by software polling, the other logic signals  don’t need a special treatment

 

I you are familiar with “C” language you should understand the software

 

The program is well commented, part in English, part in French  J

 

Some slight modifications are to be made in the JB electronic, keyboard diode to be inverted and a small cut in the power supply regulator board.

 

To debug the program you need a PIC “In circuit debugger” (IDC2)

Regards

 

De : rocko...@googlegroups.com [mailto:rocko...@googlegroups.com] De la part de Richard Ruddick
Envoyé : mercredi 7 mai 2014 16:23

To unsubscribe from this group and stop receiving emails from it, send an email to rockola477+...@googlegroups.com.


To post to this group, send email to rocko...@googlegroups.com.

juke.c

paolo.o...@gmail.com

unread,
Apr 28, 2025, 4:03:45 PMApr 28
to rockola477
Hello everyone, my name is Paolo and I live in Italy. Now I'm retired and can dedicate time to my Jukeboxes.

My Rock Ola 481 has not been making selections for some time, I think the Credit Unit is definitely dead. I found your work very interesting and I would like to replace the Profit Setter with the Pic board. Please, I am looking for someone who has the time and desire to send me schematics and other useful material (or where I can find it) for building the board.

 Thanks in advance and many compliments again for the excellent work done.

Best Regards
Paolo

Reply all
Reply to author
Forward
0 new messages