Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

my uC 1/2 works

Status
Not open for further replies.

mstechca

New Member
Ya know what?

It seems that most programs now have no access to my parallel port after driving it with 12V (accidently).

however, I made my microcontroller programmer work with it! I used direct addressing. All I used were the strobe, busy, and data lines. Since those work normally, I'm happy with the port.

But here is what I am finding with my uC (AT89C2051):

When I perform the chip erase function, it erases the chip and restores everything in the flash ram to factory defaults.

When I program the chip, it seems to be ok, BUT when I set the chip to read the programmed data, the data is NOT the same, even though I connected the pins as follows:

Parallel port D0 to P1.0
Parallel port D1 to P1.1
Parallel port D2 to P1.2
Parallel port D3 to P1.3
Parallel port D4 to P1.4
Parallel port D5 to P1.5
Parallel port D6 to P1.6
Parallel port D7 to P1.7

No pins are touching each other in the wrong way. ATMEL states that the programming modes are established using P3.3, P3.4, P3.5, and P3.7.

When I leave these pins floating, it seems that the output of the P1 pins are 1's. I thought that leaving all port pins floating with the reset switch into the non-reset position and leaving the clock running will execute the code.

Here is my code.

mov &H90,&HF ' Move to software address 90h the value 16 (bit 4 on)
ljmp 0 'jump to the beginning.

and this is what I am sending to the programmer in the following order (h = hexadecimal):

75h
90h
0Fh
02h
00h
00h

The above codes are first converted into the ascii equivalents before they are sent.

What should happen when the microcontroller runs is that bit 4 should be set and the other bits are cleared, and the process repeats.

I don't understand why it isn't working, and the uC depends on the 8051 instruction set.
 
mstechca said:
Here is my code.

mov &H90,&HF ' Move to software address 90h the value 16 (bit 4 on)
ljmp 0 'jump to the beginning.

and this is what I am sending to the programmer in the following order (h = hexadecimal):

75h
90h
0Fh
02h
00h
00h

&HF does not turn bit 4 ON. It turns bit0-3 ON. :twisted:

Try the value &H10 instead.
 
thats what I meant to say. 0 - 3. but even that, the right data still doesn't appear. It seems that even bit 8 or bit 7 are modified!
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top