Maker Pro
Maker Pro

Help needed for programming of microcontrollers and associated chips.

A

adam

Hi Group,
We wish to thank you all for the immediate and informative response to
our previous topic.
We wish to know about programming the microcontroller and associated
chips this time.
These are the chips we have decided to use:
AT89C52/AT89S52: MICROCONTROLLER
DS1307: RTC
MAX232/MAX485: LEVEL CONVERTER
AT24C1024: SERIAL EEPROM
4051B: 8:1 ANALOG MUX
LM339: COMPARATOR

1. What are the different stages that go into programming from start to
end?
2. What are the various software requirements at each stage?
3. We have searched and got some routines and codes from the internet.
But these are for 8051 or for other derivatives. Is there some website
from where basic codes like read/write/erase of EEPROM, Programming of
RTC and Reading RTC, etc can be available.
4.Lastly we are using RS232c cable for PC interface. We wish to display
a few details like pin number and the real time clock n the PC in the
simplest way. Please suggest ways to go about it. some have suggested
Visual Basic. Are VB codes for such application availalbe on the
internet?

We wait for positive response.
Thanking you and with best regards,
Adam Mashraqui.
(on behalf of the group)
 
K

Ken Smith

adam said:
1. What are the different stages that go into programming from start to
end?

Here it is don't miss any steps. Once you become experienced, you can
start combining steps.

(1)
Write a vague description of what you are trying to make the programmed
part do. Don't worry about details just get the titles for all the big
ideas down on paper.

(2)
Review the description and often throw sections away and start again. Ask
your self "could a complete idiot understand this?" and "could a smart
person find a way to misunderstand this?".

(3) Write a more detailed specification of what you are trying to do.
This should be written in a format with no more than about 73 characters
per line so that it can be turned into comments easily. Use a very simple
text editor. Don't write any code at this point.

(4)
Break the problem down into smaller parts. Start looking at things like
how many bits are needed in your numbers. At this point you should be
writing stuff in the form of comments for the source code. It isn't too
hard to convert comments from one language to another.

(5)
Break those parts down further. Carefully re-examine issues like how many
bits are needed for values. About here is where you should start thinking
about what language you will use.

(5A)
Look at any obvious looping sections and ask "if this takes one machine
cycle per loop will it take the entire life of the universe to complete".
If so, you are in trouble already.

(6)
Determine how each step in the processing can be done and perhaps start
writing some code.

(6A)
Repeat the (5A) check for any new loops you see.

(7)
Go back a re-read the vague description you started with and compare it
with the now detailed stuff. Make sure that you have gone astray.

(8)
Write source code for some of the subsections and code to test those
subsections. Start with the things you are least sure of.

(9)
Now you need a compiler. Turn on all the warnings that the compiler has
and feed your source code in.

(10)
Fix everything that the compiler warned you about.

(11)
Compile and link a test program. You need the compiler and linker.

(12)
If you are using an emulator, load the code into it. If not perhaps you
need to program a part. If so you will need the "hex" format that the
porgrammer needs and the programmer.

(13)
Run the test code and see what doesn't work.

(14)
Figure out what you did wrong.

(15)
Fix the mistakes and repeat from (11)

(16)
Add more stuff to the program and repeat from (11)

(17)
Compare what you have to what you want and if needed repeat from (1)


[...]
simplest way. Please suggest ways to go about it. some have suggested
Visual Basic. Are VB codes for such application availalbe on the
internet?

Run a simple terminal program on the PC. Hyperterminal is free but nearly
imposible to use. Procomm, Commo, Microcom, and Picocom are all simple
programs.

You can verify that you can work the program by linking two PCs together
and typing stuff back and forth.

Now just make your 8051 code output plain ASCII text for what you want to
display.
 
Top