8051 educational kit

XCore Project reviews, ideas, videos and proposals.
User avatar
octal
XCore Addict
Posts: 228
Joined: Thu Jan 27, 2011 3:30 pm
Location: Argenteuil - France

8051 educational kit

Post by octal »

I posted an idea that is eating my head since more than 6 months, something that I tought to make using a PIC32 or an FPGA last year, but I never got time to do it because of various (professionnal) problems.
Now that I have a better knowledge of XMOS devices, I think that XMOS is THE true solution for it, and I'm going to make it in next few weeks. (at least using an XK1 board plugged on another proof of concept board at the moment).
The choice of the 8051 as a processor is entierely hypotetical, as it's one of the processors I know. Any other processor can be used instead Z80 (heater is here :lol: ), 6809, 6502, 68000...
We can even implement a virtual CPU core on another XMOS (like the DIYCalculator), or an emulator for another processor...

Feel free to join and comment the project https://www.xcore.com/projects/8051-educational-kit :geek:
Depending on feedbacks, I (we) may change the target processor :)


ale500
Respected Member
Posts: 259
Joined: Thu Sep 16, 2010 9:15 am

Post by ale500 »

Have you thought about the ZPU ? it is really simple and the tool chain for large programs already exist. I think Heater wanted to work on it but well I do not know in which state it is. I'd suggest you start with something you know well and then go to some unknown but maybe more powerful one like the 68000. The 68k is the one I wanted t implement, I did not have a chance yet to implement my ideas but I thought that dynamic recompilation using a couple of threads could be the way to go...
User avatar
octal
XCore Addict
Posts: 228
Joined: Thu Jan 27, 2011 3:30 pm
Location: Argenteuil - France

Post by octal »

Hi ale500,
I tought to ZPU (idem for the DIYCalculator processor), but the main idea was NOT to make a hardware emulator to a CPU. The idea was mainly to have the XMOS control a true hardware bus of a true hardware processor (and I personally have more and more tought to go 68K or Z80 instead of 8051, this is why I started this discussion ;) ).
The fact that I want it to manage a true hardware processor is because this will let users work on true hardware, be able to measure signals, check clock, SEE HARDWARE working.
Emulation has the drawback of hiding all that, this means that my dev board will not be more than a PC like emulator for any mcu controlling an external ram, and this is what I wanted to avoid.
Last edited by octal on Tue Mar 01, 2011 1:06 pm, edited 3 times in total.
User avatar
TonyD
XCore Addict
Posts: 234
Joined: Thu Dec 10, 2009 11:11 pm
Location: Newcastle, UK

Post by TonyD »

I would consider doing a Z80 or 6502 emulator first before the 8051 as there's already lots of examples you can port to Xmos.

There's a 6502 emulator in the XC-1 SID emulator project on the old xmoslinkers site

http://archive.xmoslinkers.org/node/240

that said, I really like to idea of using a Xmos to emulator other micros.
ale500
Respected Member
Posts: 259
Joined: Thu Sep 16, 2010 9:15 am

Post by ale500 »

Sorry but I don't know exactly what you want to do. Do you want to emulate all the signals to replace a processor in a specific target board or just emulate in software to run some already compiled program where only the software remains from the emulated system ?
User avatar
octal
XCore Addict
Posts: 228
Joined: Thu Jan 27, 2011 3:30 pm
Location: Argenteuil - France

Post by octal »

ale500 wrote:Sorry but I don't know exactly what you want to do. Do you want to emulate all the signals to replace a processor in a specific target board or just emulate in software to run some already compiled program where only the software remains from the emulated system ?
It's NOT AN EMULATOR !

Imagine a system having a 68K (if we go for 68000), a true hardware 68K with an external 64KB of RAM, with Clock generation circuitery.
To have the 68K load the program to execute to its external RAM, we mainly have an external ROM (Eprom or EEprom) that is multiplexed with the RAM, and that contains the program or a monitor program that will give you the needed interactivity to load the program.

This is a NORMAL trarditional dev kit !

Now where is my XMOS.
Imagine I take the same system as before,
1- I remove the ROM, as I can have my XMOS load the program directly from PC to the external RAM
2- the XMOS monitors all pins of the RAM (control signals and data/adr pins).
3- I remove the Clock generation circuiteray and let the XMOS do that. The XMOS will clock the 68K.

With that at hand, the XMOS now masters the 68K frequency (and can stop it, step it, ...), so you can for example have two buttons (physical switches) managed by the XMOS to ask it to give one clock pulse to 68K to advance PC, 8 Clock pulses to do Mult operation ...

XMOS now is able to read at any moment what is being written or read to/from the 68K external memory. if XMOS stops the 68K (locks the clock), it can give you the possibility to dump the 68K external memory and send all content to PC software ... you can check memory state ...
if I add a keyb and an LCD or 7Seg displays to XMOS, it can give you even the possibility to enter directly (without PC) values to any adr to the 68K external RAM to change a var value or to patch an opcode!!!!

with that, the XMOS will let you CONTROL completely the cycles of execution of your program !

this is not an emulator, it use true processor silicon .... XMOS is only a controller. XMOS will act as a true hardware debugger that can LOCK the entire system (68K+its RAM) at any moment and give you entire control over the content of the 68K external RAM (code+data, this is why I do that on processors and not MCUs where you dont have any control over internal ram).

Sorry for my bad english (I'm not native english) but I don't know if you understand me or not.
maybe I'll upload some more details and schematics about what I want to achieve to make it easy to figure out what's the goal of the project.
User avatar
TonyD
XCore Addict
Posts: 234
Joined: Thu Dec 10, 2009 11:11 pm
Location: Newcastle, UK

Post by TonyD »

OK I understand now, its a ICE (in-circuit emulator) or pseudo ICE as its not using a modified processor. So has no access to the 68K's internal registers but it is controlling the targets clock for run, stop and single-step operations and dumping blocks of external memory for reviewing.
User avatar
octal
XCore Addict
Posts: 228
Joined: Thu Jan 27, 2011 3:30 pm
Location: Argenteuil - France

Post by octal »

Yes Tony,
it's that !!! and don't forgot that it's an EDUCATIONAL tool, so the idea is not to have the most effective tool to check and develop code, it's mainly to have more interactivity and more inspection possibilities over bits flow.

We cannot, of course, have access to the internals of the processor. User can still use some dumping code if needed for that.

Later, if this project succeed, I may try to implement a full processor (Z80, or 68K equivalent) on an XMOS. In this case, it still will be an additional component in order to let students "SEE" the signals, see what's happening, see how the processor control its signals when it goes in halt state, when it react to an external interrupt, ...

The main idea is always: use a TRUE USE CASE and not a virtual "perfect" "ideal" processor, and let user see what's happening and how it's happening.
ale500
Respected Member
Posts: 259
Joined: Thu Sep 16, 2010 9:15 am

Post by ale500 »

Now I get what you want... that will need level shifters if you use the L instead of the G devices. I would start with a slower and simpler processor like the Z80, the 68k hat pre-fetch and that sometimes complicates debugging, in my experience but you get custom to it.
User avatar
octal
XCore Addict
Posts: 228
Joined: Thu Jan 27, 2011 3:30 pm
Location: Argenteuil - France

Post by octal »

G series is out of question right now cause of BGA soldering problems.

I need to use the L series. It's not a problem to use level shifters. I'm using the MC74LCX16245DTG (16 bit) for the XMOSCOPE project and it works very well and costs less than $1 (it goes up to 200MHz and 5.5V).

I can also use Z180 as cpu, it's close to Z80 and works fine at 3.3V. It's an educational tool, I have no constraints.

For Z80, some CMOS variants (not produced by ZILOG)work at 3.3V. Zilog serie work only at 5V (I need to check). The clock is almost static on CMOS variants, so I can stop it and restart it without problem.

Another solution, would be that someone develop here a 8051 or a Z80 core on an XMOS XS1, and we can use it as the main processor. The second XS1 will handle the bus and RAM as stated.
This can be better as we can have trully access to the processor internals in this case (stack pointer value, registers, PC, ....) .

This is an educational tool ... and this thread is a simple IDEA PROPOSAL .... so any idea will be welcome. We will synthesize everything in few days and can put online a true and final project :)