Author Topic: A fairly simple 8051-based SBC project.  (Read 12342 times)

0 Members and 1 Guest are viewing this topic.

Offline technixTopic starter

  • Super Contributor
  • ***
  • Posts: 3507
  • Country: cn
  • From Shanghai With Love
    • My Untitled Blog
A fairly simple 8051-based SBC project.
« on: December 03, 2016, 10:47:03 pm »
Here is the features I shot for on this project:

* 8051-compatible processor: AT89C51RC @ 24MHz
* Von Neumann connected system bus
* 32kB EEPROM, 32kB SRAM (0x0000 - 0x7fff = AT28C256, 0x8000 - 0xffff = IS61C256)
* PIC16F1455 for USB virtual serial port and system control (including reset)
* Serial 128x64 graphic display (ST7920 controller, contains built-in character generator)
* PS/2 interface for keyboard
* DS1307 RTC
* Buzzer
* Fully through hole construction
* Board size identical to the LCD display module

How do you guys think?

I found PIC16F1455. Here is the (almost) complete BOM:

* 1x AT89C51RC-24PU
* 1x SN74HC00N
* 1x SN74HC573N
* 1x IS61C256AH-15N
* 1x AT28C256-15PC
* 1x PIC16F1455-I/P
* 1x DS1307N
* 1x ST7920-based LCD module
* 1x USB Mini-B connector
* 1x PS/2 connector
* 2x 22 \$\Omega\$ resistors
* 2x 4.7k \$\Omega\$ resistors
* 7x 220nF MLCC
* 2x 22nF ceramic disk capacitor
* 1x 16MHz HC-49/S crystal (12MHz will work too, with different fuse settings in the PIC though)
* 1x 32768Hz warch crystal
* 1x buzzer
* 1x SS9015 PNP BJT
* 1x 2N7000 NMOSFET

The PIC16F1455 generates the 24MHz clock for 8051 from its internal 48MHz clock, provides USB CDC, and handles switching the 8051 between internal ROM and external ROM booting.
« Last Edit: December 07, 2016, 01:02:25 pm by technix »
 

Offline ChristofferB

  • Frequent Contributor
  • **
  • Posts: 929
  • Country: dk
  • Chemistry phd student!
    • My channel:
Re: A fairly simple 8051-based SBC project.
« Reply #1 on: December 03, 2016, 11:48:23 pm »
Sounds interesting! What code is it going to run? Something BASIC-y?
--Christoffer //IG:Chromatogiraffery
Check out my scientific instruments diy (GC, HPLC, NMR, etc) Channel: https://www.youtube.com/channel/UCZ8l6SdZuRuoSdze1dIpzAQ
 

Offline technixTopic starter

  • Super Contributor
  • ***
  • Posts: 3507
  • Country: cn
  • From Shanghai With Love
    • My Untitled Blog
Re: A fairly simple 8051-based SBC project.
« Reply #2 on: December 04, 2016, 08:30:35 am »
Sounds interesting! What code is it going to run? Something BASIC-y?
I have not figured out what code I should make it run yet. The wiring along with the 32kB internal ROM in the chip allows me to go both ways. My original plan was to run native code only, using the internal ROM as a bootloader, and store actual application code in the external EEPROM. If I ended up running BASIC, the interpreter and OS will have to sit in the internal ROM while the external ROM is used as a filesystem of sorts.
 

Offline JPortici

  • Super Contributor
  • ***
  • Posts: 3461
  • Country: it
Re: A fairly simple 8051-based SBC project.
« Reply #3 on: December 04, 2016, 10:26:03 am »
Quote
I may run into sourcing problems as PIC16F1455 is very difficult to hunt down
why? are you planning to do tens of thousands of units? still, usually microchip's lead time is less than 10 weeks
 

Offline technixTopic starter

  • Super Contributor
  • ***
  • Posts: 3507
  • Country: cn
  • From Shanghai With Love
    • My Untitled Blog
Re: A fairly simple 8051-based SBC project.
« Reply #4 on: December 04, 2016, 11:22:56 am »
Quote
I may run into sourcing problems as PIC16F1455 is very difficult to hunt down
why? are you planning to do tens of thousands of units? still, usually microchip's lead time is less than 10 weeks
I can't find them in local electronic component stores.
 

Offline JPortici

  • Super Contributor
  • ***
  • Posts: 3461
  • Country: it
Re: A fairly simple 8051-based SBC project.
« Reply #5 on: December 04, 2016, 12:18:22 pm »
fair enough, though i bet ebay or microchip sample program can be of help
still, microchip direct has ton of them and (at least here) 10€ shipping
 

Offline stfsux

  • Contributor
  • Posts: 23
  • Country: 00
Re: A fairly simple 8051-based SBC project.
« Reply #6 on: December 04, 2016, 12:43:34 pm »
* Von Neumann connected system bus
I'm not sure to understand.
i8051 is normally a modified harvard architecture, or are you talking about something else?
 

Offline Kalvin

  • Super Contributor
  • ***
  • Posts: 2145
  • Country: fi
  • Embedded SW/HW.
Re: A fairly simple 8051-based SBC project.
« Reply #7 on: December 04, 2016, 03:51:09 pm »
* PIC16F1455 for USB virtual serial port and system control (including reset)

If you just want a USB serial port, why don't you use those cheap FTDI or similar USB-to-serial modules available on eBay for $1.30? Typically those modules have DTR-signal which can be used for the reset purposes.
 

Offline technixTopic starter

  • Super Contributor
  • ***
  • Posts: 3507
  • Country: cn
  • From Shanghai With Love
    • My Untitled Blog
Re: A fairly simple 8051-based SBC project.
« Reply #8 on: December 04, 2016, 04:40:56 pm »
* PIC16F1455 for USB virtual serial port and system control (including reset)

If you just want a USB serial port, why don't you use those cheap FTDI or similar USB-to-serial modules available on eBay for $1.30? Typically those modules have DTR-signal which can be used for the reset purposes.
8051 needs external active-high POR  which should be present regardless of the prescence of a USB host, and this chip generates that signal. It also generates the signal intended for the EA pin if I decided to store native code on the EEPROM and use the onboard ROM as a bootloader.  I don't think that a simple USB to serial chip can do all those. In fact the USB interface will have to be a bit more complicated for that.
 

Offline jesuscf

  • Frequent Contributor
  • **
  • Posts: 499
  • Country: ca
Re: A fairly simple 8051-based SBC project.
« Reply #9 on: December 04, 2016, 05:38:37 pm »
Either the AT89LP51RD2 or the AT89LP51ED2 are a much better option than the AT89C51RC.  They both come with 64k of ISP Flash and 2k of RAM.  The ED2 comes with 4k of EEPROM as well.  On top of that you'll get a built-in serial boot loader, a one clock per cycle CPU, and a sometimes usable 10-bit ADC.
Homer: Kids, there's three ways to do things; the right way, the wrong way and the Max Power way!
Bart: Isn't that the wrong way?
Homer: Yeah, but faster!
 

Offline technixTopic starter

  • Super Contributor
  • ***
  • Posts: 3507
  • Country: cn
  • From Shanghai With Love
    • My Untitled Blog
Re: A fairly simple 8051-based SBC project.
« Reply #10 on: December 04, 2016, 09:30:04 pm »
Either the AT89LP51RD2 or the AT89LP51ED2 are a much better option than the AT89C51RC.  They both come with 64k of ISP Flash and 2k of RAM.  The ED2 comes with 4k of EEPROM as well.  On top of that you'll get a built-in serial boot loader, a one clock per cycle CPU, and a sometimes usable 10-bit ADC.
I cannot source them (similar situation as PIC16F1455 - in fact AT89LP series faces extremely harsh competition from STC equivalents that is much cheaper, so they are even more expensive to find and nigh impossible to find.)

And this design being a dual purpose (running BASIC using interpreter in internal Flash, or running native code directly off the external EEPROM) means the processor must be able to be forced external code and data memory in Von Neumann bus.
« Last Edit: December 05, 2016, 05:41:24 am by technix »
 

Offline westfw

  • Super Contributor
  • ***
  • Posts: 4199
  • Country: us
Re: A fairly simple 8051-based SBC project.
« Reply #11 on: December 05, 2016, 03:40:33 am »
Quote
Quote
Von Neumann connected system bus
I'm not sure to understand.   i8051 is normally a modified harvard architecture
Presumably he means that he's setting up the bus so that external RAM and external Program space share the same bus.  (that probably means that a chip with 64k internal memory is "undesirable", because you'd want to have the flexibility of putting some code in the external memory.   Or do the 64k versions have a provision for turning off internal flash in pieces?)
 

Offline ebclr

  • Super Contributor
  • ***
  • Posts: 2328
  • Country: 00
Re: A fairly simple 8051-based SBC project.
« Reply #12 on: December 05, 2016, 06:36:30 am »
I don't know why you want to do this board, it's hard to understand

I would suggest buy this one and you your time for some other stuff like firmware

https://world.taobao.com/item/37792947308.htm?spm=a312a.7700714.0.0.fRMBBX#detail
 

Offline technixTopic starter

  • Super Contributor
  • ***
  • Posts: 3507
  • Country: cn
  • From Shanghai With Love
    • My Untitled Blog
Re: A fairly simple 8051-based SBC project.
« Reply #13 on: December 05, 2016, 11:24:55 am »
I don't know why you want to do this board, it's hard to understand

I would suggest buy this one and you your time for some other stuff like firmware

https://world.taobao.com/item/37792947308.htm?spm=a312a.7700714.0.0.fRMBBX#detail
Do that thing get any chance to run BASIC? Does that board also serve as a teaching tool for students learning computer consistency?
 

Offline stfsux

  • Contributor
  • Posts: 23
  • Country: 00
Re: A fairly simple 8051-based SBC project.
« Reply #14 on: December 05, 2016, 12:02:10 pm »
@westfw oh yeah ok. nvm  8)
 

Offline ebclr

  • Super Contributor
  • ***
  • Posts: 2328
  • Country: 00
Re: A fairly simple 8051-based SBC project.
« Reply #15 on: December 06, 2016, 06:30:44 am »
For sure, and better than 89C51, that board is only a cheaper, smaller and faster 89C51 also less power from supply
« Last Edit: December 06, 2016, 06:33:45 am by ebclr »
 

Offline technixTopic starter

  • Super Contributor
  • ***
  • Posts: 3507
  • Country: cn
  • From Shanghai With Love
    • My Untitled Blog
Re: A fairly simple 8051-based SBC project.
« Reply #16 on: December 06, 2016, 06:34:27 am »
For sure, and better tha 89C51, that board is only a cheaper, smaller and faster 89C51
I have that exact chip. And no it does not work in this design. STC chips does not have the required EA pin.
 

Offline ebclr

  • Super Contributor
  • ***
  • Posts: 2328
  • Country: 00
Re: A fairly simple 8051-based SBC project.
« Reply #17 on: December 06, 2016, 11:39:24 am »
Chip is not STC

Is silabs

Why external memory, if all memory address are filled up internally



 

Offline technixTopic starter

  • Super Contributor
  • ***
  • Posts: 3507
  • Country: cn
  • From Shanghai With Love
    • My Untitled Blog
Re: A fairly simple 8051-based SBC project.
« Reply #18 on: December 06, 2016, 01:23:23 pm »
Chip is not STC

Is silabs

Why external memory, if all memory address are filled up internally
Can I fill the data into the external memory, and immediately jump into it? I am using a Von Neumann external bus.
 

Offline ebclr

  • Super Contributor
  • ***
  • Posts: 2328
  • Country: 00
Re: A fairly simple 8051-based SBC project.
« Reply #19 on: December 06, 2016, 01:34:45 pm »
I put the wrong link

the correct is

https://world.tmall.com/item/12500559730.htm?spm=a312a.7700714.0.0.D7Zo2C

Yes you can access external memory   ( http://www.silabs.com/Support%20Documents/TechnicalDocs/C8051F32x.pdf )

12.1. Accessing User XRAM
XRAM can be accessed using the external move instruction (MOVX) and the data pointer (DPTR), or using
MOVX indirect addressing mode. If the MOVX instruction is used with an 8-bit address operand (such as
@R1), then the high byte of the 16-bit address is provided by the External Memory Interface Control Register
(EMI0CN as shown in Figure 12.1). Note: the MOVX instruction is also used for writes to the Flash
memory. See Section “11. Flash Memory” on page 106 for details. The MOVX instruction accesses XRAM
by default.
For any of the addressing modes the upper 5 bits of the 16-bit external data memory address word are
"don't cares". As a result, the 2048-byte RAM is mapped modulo style over the entire 64k external data
memory address range. For example, the XRAM byte at address 0x0000 is also at address 0x0800,
0x1000, 0x1800, 0x2000, etc.
Important Note: The upper 1k of the 2k XRAM functions as USB FIFO space. See Section 12.2 for
details on accessing this memory space.
 

Offline ebclr

  • Super Contributor
  • ***
  • Posts: 2328
  • Country: 00
Re: A fairly simple 8051-based SBC project.
« Reply #20 on: December 06, 2016, 01:37:51 pm »
If this will be used for educational purposes , i would sugest take a look here

http://www.edsim51.com/
 

Offline technixTopic starter

  • Super Contributor
  • ***
  • Posts: 3507
  • Country: cn
  • From Shanghai With Love
    • My Untitled Blog
Re: A fairly simple 8051-based SBC project.
« Reply #21 on: December 06, 2016, 03:47:19 pm »
I put the wrong link

the correct is

https://world.tmall.com/item/12500559730.htm?spm=a312a.7700714.0.0.D7Zo2C

Yes you can access external memory   ( http://www.silabs.com/Support%20Documents/TechnicalDocs/C8051F32x.pdf )

12.1. Accessing User XRAM
XRAM can be accessed using the external move instruction (MOVX) and the data pointer (DPTR), or using
MOVX indirect addressing mode. If the MOVX instruction is used with an 8-bit address operand (such as
@R1), then the high byte of the 16-bit address is provided by the External Memory Interface Control Register
(EMI0CN as shown in Figure 12.1). Note: the MOVX instruction is also used for writes to the Flash
memory. See Section “11. Flash Memory” on page 106 for details. The MOVX instruction accesses XRAM
by default.
For any of the addressing modes the upper 5 bits of the 16-bit external data memory address word are
"don't cares". As a result, the 2048-byte RAM is mapped modulo style over the entire 64k external data
memory address range. For example, the XRAM byte at address 0x0000 is also at address 0x0800,
0x1000, 0x1800, 0x2000, etc.
Important Note: The upper 1k of the 2k XRAM functions as USB FIFO space. See Section 12.2 for
details on accessing this memory space.
What I mean is 1) reading and writing code memory on the fly and 2) execute code that is just written.
 

Offline Bruce Abbott

  • Frequent Contributor
  • **
  • Posts: 627
  • Country: nz
    • Bruce Abbott's R/C Models and Electronics
Re: A fairly simple 8051-based SBC project.
« Reply #22 on: December 06, 2016, 05:51:59 pm »
What I mean is 1) reading and writing code memory on the fly and 2) execute code that is just written.
You can do this if you make the external RAM respond to both program and data memory requests. /PSEN goes low to indicate reading external program memory, while /RD or /WR goes low when accessing external data memory. RAM /CE (and /OE) could be generated by combining /PSEN, /RD, and /WR with a 3 input AND gate.

On the AT89C51RC, connecting /AE to +5V maps the lower 32k of program memory to internal Flash and the upper 32k to external ROM. So you could have 32k of operating system in internal Flash, and 32k of external RAM for user programs and data. 
 

Offline technixTopic starter

  • Super Contributor
  • ***
  • Posts: 3507
  • Country: cn
  • From Shanghai With Love
    • My Untitled Blog
Re: A fairly simple 8051-based SBC project.
« Reply #23 on: December 06, 2016, 07:38:37 pm »
What I mean is 1) reading and writing code memory on the fly and 2) execute code that is just written.
You can do this if you make the external RAM respond to both program and data memory requests. /PSEN goes low to indicate reading external program memory, while /RD or /WR goes low when accessing external data memory. RAM /CE (and /OE) could be generated by combining /PSEN, /RD, and /WR with a 3 input AND gate.

On the AT89C51RC, connecting /AE to +5V maps the lower 32k of program memory to internal Flash and the upper 32k to external ROM. So you could have 32k of operating system in internal Flash, and 32k of external RAM for user programs and data.
I have 32k SRAM (0x8000 - 0xffff) and 32k EEPROM (0x0000 - 0x7fff,) making full 64k external memory, so slightly different wiring:

/OE = /PSEN * /RD
/WE = /WR
/CS(EEPROM) = A15
/CS(RAM) = /A15

So, all those is going through one  74HC00.
 

Offline technixTopic starter

  • Super Contributor
  • ***
  • Posts: 3507
  • Country: cn
  • From Shanghai With Love
    • My Untitled Blog
Re: A fairly simple 8051-based SBC project.
« Reply #24 on: December 08, 2016, 09:13:14 am »
Now I got a breadboard prototype up, how do I implement a boot loader and a BASIC interpreter then?

Do you guys consider this a good idea, instead of implementing the interpreter in 8051 directly, implement a byte code virtual machine in the onboard ROM, and create a BASIC compiler (or LLVM backend if I want C and C++) targeting this byte code for PC.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf