Continue to Site

# 8051 Microcontroller Problem

Status
Not open for further replies.

#### salamander

##### Member level 2
c515 use of xdata

Hallo
sometime ago I started a new microcontroller project an so I started to develop an Board based on the famouse Dallas 80C320 microcontroller: schematics

The parts I used: for memory adressing I used a 74HCT00 standard logic, as latch I used a 74HCT573, the uC as said a Dallas 80C320 (also tried Intel 80C32), the Eprom is a 27C256 and as ram I used a 62256[32k]...

But the problem is, it does not run
I have allready inserted the third eprom with the same program and so there is the question, did I something basicly wrong?!?

the error: wenn I power on the board(all parts inserted except the eprom)everything goes right(on both adress and databus is "action"), but when I insert the eprom the upper 8 bits of the adressbus are only rubish(some low, some high but no data).

Until now I built the board two times, but I does not run until today!

Thanks to all who read this text and had fun with by bad english...it would also be ok if you write me, that I mad everythin right 8)

thanks a lot
salamander

#### barny

##### Member level 1
80c32 reset problems

One problem is that OE of the RAM should just use /RD - no need for gating with /PSEN.

Also don't understand why A15 is going to A14 of RAM/EPROM and A14 is driving Chip Select decoding. Why not use A15 as CE for EPROM and /A15 as CE for RAM?

Is your eprom fast enough? Dallas databooks have an app note for working out ROM/RAM speed vs crystal and type of latch. If in doubt, try a much slower crystal (e.g. 1MHz?) so there is no doubt access is working fine.

Program the whole of your eprom with NOP and the address lines should do binary counting; a1 at half freq of A0, A2 at half freq of A1, etc.

#### barny

##### Member level 1
the 8051 microcontroller problems

One problem is that OE of the RAM should just use /RD - no need for gating with /PSEN.

Also don't understand why A15 is going to A14 of RAM/EPROM and A14 is driving Chip Select decoding. Why not use A15 as CE for EPROM and /A15 as CE for RAM?

Is your eprom fast enough? Dallas databooks have an app note for working out ROM/RAM speed vs crystal and type of latch. If in doubt, try a much slower crystal (e.g. 1MHz?) so there is no doubt access is working fine.

Program the whole of your eprom with NOP and the address lines should do binary counting; a1 at half freq of A0, A2 at half freq of A1, etc.

#### usbman

74hct573 sram project

barny said:
One problem is that OE of the RAM should just use /RD - no need for gating with /PSEN.

Also don't understand why A15 is going to A14 of RAM/EPROM and A14 is driving Chip Select decoding. Why not use A15 as CE for EPROM and /A15 as CE for RAM?

Such a scheme is needed when when you want to load user code via rom monitor. (von Neuman Architecture)
BTW. this is the std schematic used in old electors for their 8032 boards.

UsbMan

#### usbman

what is the best ram for 8051 microcontroller

salamander said:
Hallo

But the problem is, it does not run
I have allready inserted the third eprom with the same program and so there is the question, did I something basicly wrong?!?

the error: wenn I power on the board(all parts inserted except the eprom)everything goes right(on both adress and databus is "action"), but when I insert the eprom the upper 8 bits of the adressbus are only rubish(some low, some high but no data).
Why do you think your board is not running ?
Depending on the program it will be ok that you see static hi/lo on p2.
(small endless loop like jmp $for example) The are only tow things Ii found in your schematic : You should name all busmembers so everbody can see what you are trying to do. The other thing ist your max232 this will never work. Read the datasheed ! UsbMan #### barny ##### Member level 1 the 8051 microcontroller problem usbman said: Such a scheme is needed when when you want to load user code via rom monitor. (von Neuman Architecture) UsbMan Fair enough. But why split A14/15? just makes it hard to load the full EPROM and there's no advantage (unless you've got old code that was written for that memory map). It's either wiring or crystal speed. The EPROM has to be very fast to run at anything like max speed of the C320, and you need high-speed AC latch to even try, not HCT. A friend had this prob, board just didn't work until changed to 70ns EPROM and AC-type latch. #### usbman ##### Advanced Member level 4 barny said: Fair enough. But why split A14/15? just makes it hard to load the full EPROM and there's no advantage (unless you've got old code that was written for that memory map). It's either wiring or crystal speed. The EPROM has to be very fast to run at anything like max speed of the C320, and you need high-speed AC latch to even try, not HCT. A friend had this prob, board just didn't work until changed to 70ns EPROM and AC-type latch. As already said this was the std mem map for Elektor boards using the Elektor monitor /tools. This memmap only makes sense when he wants to use a monitor Splitting A14/A15 is neccessary because the elektor Mon requires ram at 0x4000 for downloading code and this is a simple solution to get 32k coderam from 0x4000 to 0xBFFF. There are of course several other posibilities, but most of them need more logic or a GAL. I am using a similar thing for my own boards. This decoder only needs one HC00! I don't think there is a problem with the xtal/speed because he wrote that a std 8032 did not work too. I think his eprom code can not handle the 80c320 and his MAX has no caps, so he won't see anything on the comport. UsbMan #### salamander ##### Member level 2 Hallo, thanks for your fast answers first :yes: (I was not that fast) the gating of RD and PSEN is because I need van-Neuman-wired memory (ecerpt from manual): Von-Neumann means that you can read physically the same memory bytes from code and xdata space. This is necessary to download software into code space since the 8051 does not provide CPU instructions to write into code memory. Typically a AND gate is used to combine the RD/ and PSEN/ signals of the CPU and generate a RD/ signal for the RAM device. Oh yes I need a monitor I chcked the wiring, checked it again and I really think its right... But with memory adressing you could be right! A copied this sollution from another project and this should divide my memory in four 16kbyte segments, this means: first 16kbyte EPROM then 16kbyte RAM, 16K Eprom again and at the end 16k RAM. If you can tell me another(better) sollution I will try(would be nice working with standard logic 74hct..). Yes I took this from an elektor board witch used an 80C515, they had A14 on RAM A14 and A15 on EPROM A 14, but the board bought from them has A15 on both devices, now whats right?!? But one thing is shure, its not a speed problem: I allready used an standard Intel 80C32 at 11.059Mhz and atleast this should run without problems, but It doesnt... best regards salamander #### barny ##### Member level 1 salamander said: But one thing is shure, its not a speed problem: I allready used an standard Intel 80C32 at 11.059Mhz and atleast this should run without problems, but It doesnt... salamander So what *is* in your EPROM? 1. Is the programmed correctly? Do you *know* that what is in it actually works (e.g. because it works for someone else)? How can you tell if it works? Perhaps it is, but the MAX232 problem usbman mentions is stopping you seeing it. 2. Have you tried a really simple program like all NOP's (or MOV R0,R0), or jmp$ at every location or toggling one of the spare port lines low then high, again filling the whole EPROM? That will give you some idea. The NOP one lets you check that the address lines at the EPROM are connected correctly because each one up toggles at half the speed as the processor goes through every address. (until it hits RAM :-o).

Not much else I can suggest from here.

Address mapping doesn't matter as long as you understand what it is and can figure out how to program the EPROM correctly.

Good Luck
Barny

#### salamander

##### Member level 2
Yes, the eprom ist ok... I have two boards here: one is the 80C515 from elektror running very well with my eprom and the other is the NEW board I posted the schematics from (with Intel 80C32 or Dallas80C320)) and when I insert the eprom in this board it behaves very very strange...

thx
salamander

#### barny

##### Member level 1
salamander said:
Yes, the eprom ist ok... I have two boards here: one is the 80C515 from elektror running very well with my eprom and the other is the NEW board I posted the schematics from (with Intel 80C32 or Dallas80C320)) and when I insert the eprom in this board it behaves very very strange...

thx
salamander

Ah, address map matters if you have pre-defined s/w; it has to be exactly the same as expected by the s/w in your EPROM.

Don't know the c515; have you checked that the software in EPROM is completely compatible with the c320/8051?

Luck.

#### usbman

salamander said:
Yes, the eprom ist ok... I have two boards here: one is the 80C515 from elektror running very well with my eprom and the other is the NEW board I posted the schematics from (with Intel 80C32 or Dallas80C320)) and when I insert the eprom in this board it behaves very very strange...

thx
salamander
if you are using a c515 monitor eprom which uses the dedicated baudrate generator for ser comunication this will only work with c515 not with 80c32 or 80c320. If you are using a 12MHz xtal with 9600 baud you will always need the baudrate generator.
Some 80c515 sfrs are not compatible to anything else exept to the 80c517

UsbMan

#### salamander

##### Member level 2
@usbman: you are right, but I programmed the eprom especially fro the dallas80c320(can handle multiple DPTR registers), but when I insert this eprom in my 80C515 circuit I have "action" on my address bus, but when I now insert it in the Dallas 80C320 circuit "nothing" works...

I do not use the baudrate generator, but on TIMER for baudrate generation(11.0592 bzw 22.1184 MHz crystals).

thx
salamander

#### usbman

salamander said:
@usbman: you are right, but I programmed the eprom especially fro the dallas80c320(can handle multiple DPTR registers), but when I insert this eprom in my 80C515 circuit I have "action" on my address bus, but when I now insert it in the Dallas 80C320 circuit "nothing" works...

Check the following:
1. Reset is high activ at 80C320 so put a pushbutton at pin 9 against vcc
2. xtal oszilating ?
3. ALE oszilating ?
4. PSEN oszilating
5. WR + RD oszilating ?

use the following prog to check if there is somthing wrong
org 0
mov dptr,#4000h
loop:
CPL P1.1;
MOVX A,@DPTR
MOVX @DPTR,A
JMP Loop;
this sould produce a frequ at P1.1, RD and WR.

Are you using Mon51 vrom K*eil ?
Which Options ?

UsbMan

#### salamander

##### Member level 2
@usbman: at first a big thanks that you really try to help me, now to your questins:
1. I have an cheap reset circuit at my board like shown on the schematics, but I've also installed an jumper on the board and deactivated it, because the dallas has an power-on reset on chip...
2. Yes the crystal ist oszilating at the right frequenzy

3,4 and 5 yes they are, but when I insert the eprom its like the upper 8 bit of the adresses... :roll:

...but don't think about it any more....at first I will make the eprom with the content you posted and we will see what happens.

thanks again
salamander

#### salamander

##### Member level 2
Hi,
thanks a lot again...the problem is solved now! (A capacitor was missing in front of the vcc of the microcontroller)

thx
salamander

Status
Not open for further replies.