Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] Programming 8051 compatible micro controller via USB (Linux)

Status
Not open for further replies.

PsySc0rpi0n

Newbie level 4
Joined
Oct 5, 2014
Messages
5
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
43
Hello everyone...

I'm studying Electrotecnics Engineering and we are going to program an 8051 compatible micro controller. The DS89C450.

I already built my electronic circuit and I'm using an FTDI 5V to convert RS232+MAX232 into USB to communicate with uC and I'm also using a crystal of 110592MHz.

I wrote a small program just to test things that lights on and off 8 LEds that I have connected to PORT1 of uC.

I'm using cutecom to send the code into the uC and I also have a switch that changes from RUN to PROGRAM and vice-versa.

I'm selecting the next settings in cutecom:

Device: /dev/ttyUSB0
Baud rate: 57600
Data bits: 8
Stop bits: 1
Parity: None
Open for: Reading, Writing
Hex input and Hex output

Then I select a file generated by MCU 8051 IDE and SDCC (to compile C code and Assembly) that is the Intel hex format and send it to uC.

Then I click "Close device" and change the switch to "run" mode but the LED's are not blinking as supposed!

The C/Assembly code I'm sending the uC is:


Code C - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include "reg_uC89C4xx.h"
 
void delay(unsigned long int i) //delay function
{
    while(i != 0){
        i--;
    }
}
 
void main (void) {
 
    while (1) {
        P1 = 0;
        delay (10);
        P1 = 255;
        delay (4000);
    }
}



Any help is appreciated!
 
Last edited by a moderator:

You are seeing the output not through the terminal,but through the LEDs attached to the Port A.So in the cutecom terminal settings,keep the ports open for writing only,since you are sending hex data to the controller chip and keep hex input as well in the settings.That should work..
 
Well, I did that and still not working...

I don't know if it's normal but when I connect the transformer to the circuit through a voltage regulator 7805, all the LED's are on.
Is this normal?


Then in cutecom i select those options, corrected by you, udayan92, then click "Open port", then click "send file" and select the *.ihx file and click OK.

I can see, instantly a progress bar that goes from 0 up to 100% and then another one but can't see the progress go up. It just shows up and disappears instantly. The log file says nothing, is empty...
 

Well, I did that and still not working...

I don't know if it's normal but when I connect the transformer to the circuit through a voltage regulator 7805, all the LED's are on.
Is this normal?


Then in cutecom i select those options, corrected by you, udayan92, then click "Open port", then click "send file" and select the *.ihx file and click OK.

I can see, instantly a progress bar that goes from 0 up to 100% and then another one but can't see the progress go up. It just shows up and disappears instantly. The log file says nothing, is empty...


Well, I think something it's not working but:

dmesg says this:

Code:
[32208.125629] usb 3-1: new full-speed USB device number 13 using xhci_hcd
[32208.254088] usb 3-1: New USB device found, idVendor=067b, idProduct=2303
[32208.254096] usb 3-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[32208.254100] usb 3-1: Product: USB-Serial Controller
[32208.254103] usb 3-1: Manufacturer: Prolific Technology Inc.
[32208.254453] pl2303 3-1:1.0: pl2303 converter detected
[32208.255060] usb 3-1: pl2303 converter now attached to ttyUSB0

and udevadm monitor says:

Code:
KERNEL[32218.440924] add      /devices/pci0000:00/0000:00:14.0/usb3/3-1 (usb)
KERNEL[32218.441075] add      /devices/pci0000:00/0000:00:14.0/usb3/3-1/3-1:1.0 (usb)
KERNEL[32218.441576] add      /devices/pci0000:00/0000:00:14.0/usb3/3-1/3-1:1.0/ttyUSB0 (usb-serial)
KERNEL[32218.441662] add      /devices/pci0000:00/0000:00:14.0/usb3/3-1/3-1:1.0/ttyUSB0/tty/ttyUSB0 (tty)
UDEV  [32218.467776] add      /devices/pci0000:00/0000:00:14.0/usb3/3-1 (usb)
UDEV  [32219.472157] add      /devices/pci0000:00/0000:00:14.0/usb3/3-1/3-1:1.0 (usb)
UDEV  [32219.472810] add      /devices/pci0000:00/0000:00:14.0/usb3/3-1/3-1:1.0/ttyUSB0 (usb-serial)
UDEV  [32219.474784] add      /devices/pci0000:00/0000:00:14.0/usb3/3-1/3-1:1.0/ttyUSB0/tty/ttyUSB0 (tty)

But neither in cutecom or minicom are able to communicate with the circuit as far as i can tell.
 

Which file should we send to the micro-controller? Is it the *.ihx or the *.hex????

I thought that it should be the *.ihx but someone told me that it should be the *.hex. But neither of them makes my micro-controller to work!
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top