Microcontroller ... which one ??

Hey thanks for the reminder, I did not pay attention. I thought it was "another architecture" using less and different instructions. I guess CISC is way better for me anyways. !

Reply to
~~ VerilogMan ~~
Loading thread data ...

So can i sue directly the chip ? or do I have to create a board and all that ??

Reply to
~~ VerilogMan ~~

You'll need a board, but you could use the STK-500 with the 501 adaptor. Look it up at

formatting link

This is a prototyping system, and chip programmer all in one. With this, you'd just have to connect your devices to the STK board.

Reply to
Dave VanHorn

WTF?? I haven't heard it causing any problems for tons of users in C and assembler..

Reply to
Dave VanHorn

It's just a minor irritation. Same deal with PICs and 8051s, of course.

At a low level you have to do something like tell the function where the data is secreted by adding a bit or two to the pointer. The function then uses a different instruction to read the data from RAM vs ROM vs. (maybe) EEPROM. At source-code level, it's pretty transparent, most of the time, IME.

Best regards, Spehro Pefhany

--
"it's the network..."                          "The Journey is the reward"
speff@interlog.com             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.com
Reply to
Spehro Pefhany

I wouldn't recommend it. It has a separate program and data memory space. This give problems when using constant strings in program memory and normal strings in data memory. The standard functions can't tell from which memory the string should be fetched.

--
Reply to nico@nctdevpuntnl (punt=.)
Bedrijven en winkels vindt U op www.adresboekje.nl
Reply to
Nico Coesel

I general purpose computers there are only two basic Architectures, "Von Newman," and "Harvard." Although there are many minor variations, there are only two. i.e., number os registers, organizarion of the registers, Interrupt schemes, I/O features, etc do not change the architecture!

Google for the architecture name to learn more.

Reply to
Clarence

That's true... as long as you don't touch the standard C library and write everything yourself. I recently found myself trying to get a command line interpreter -which uses the standard C library a lot- to work on a 8051 proto board to write some values in an I2C chip. In the end I looked over the assembler and found there is no way around it except for re-writing the entire program taking the memory areas into account.

Suddenly it occured to me that writing code for an 8051 wasn't efficient. Don't get me wrong here; I have been using 8051 micro's for years. The code isn't portable at all which prohibits re-using the code and writing, compiling & testing code on a PC. It can only be used on an 8051. Thats not what I wanted -at all-.

Anyway, since I already spend 2 days on it, I decided to abandon the

8051 board and use a board with a Hitachi H8/300 micro on it. I got it running within 3 hours (from cutting the CPU part from an existing scrap board, mounting an RS232 transceiver on it to getting the source compiled & loaded into the EEPROM).

The bottom line is, if you want to use C as a truly portable (and therefore efficient) language, stick with the micro's that have a single memory address space (a separate I/O space is not a problem).

--
Reply to nico@nctdevpuntnl (punt=.)
Bedrijven en winkels vindt U op www.adresboekje.nl
Reply to
Nico Coesel

I think you need to start with a more simple project then build on it once you know more.

something like sending text to a text mode lcd via rs232 do that as a couple of part project

It depends on your background, what you are trying to do ?

how you are going to get started either buying or making your own board ?

what electronics knowledge ?

Which asm ?

Most libraries you need come with the compilers

DIP - dual inline package, mounts thruough holes in the pcb so is called through hole

surface mount means it is mounted on the suface of the pcb

pcb - printed circuit board

Depends what you want, either buy a premade board with the microcontroller of your choice or buy the bits and put your own together.

Asm and c. C doesn't suit all microcontrollers though. Some weren't designed to be programmed in c.

Up to you to use or pick the language you want to use.

Even if you choose to use c you really still need to know some asm for the chip you are using.

It can manage what you want but you would need to buy a premade board if you don't have much electronics experiance. Surface mount package

formatting link
make some nice atmega128 boards can see others at avrfreaks

Avr's of which the atmega128 is one, have free tools ide for windows , + free c compiler (gcc port) even ada compiler(gcc port)

free avr forth, then quite a few commerical compilers

formatting link
compilers etc

formatting link
to get the datasheets and app notes for the atmega128

Alex

Reply to
Alex Gibson

"Nico Coesel" schreef in bericht news: snipped-for-privacy@news.planet.nl...

[snip]

My bottom line is that I don't port very often ;)

[removed all crossposts]
--
Thanks, Frank.
(remove 'x' and 'invalid' when replying by email)
Reply to
Frank Bemelman

I think if you make that statement over on comp.arch you'll get a lot of argument. AIUI (I'm just a hardware type, can't spell 'C') it is possible to write portable 'C', but it's not trivial.

That's your problem. You're starting out with hardware dependant types.

--
  Keith
Reply to
keith

In 8051 land you can combine PSEN/ and RD/ for external accesses if you really want to.

Using the 8051 with ASM and dealing with strings is usually very easy because strings that are constants, and strings that change almost never will swap roles.

The Keil C for 8051 seems to do not too bad at dealing with the issue. They also allow banking of the code space. I usually prefer to write my

8051 code in ASM so I haven't used the C that much. Folks I work with have used the C tools and lived to tell of it so it can't be all that bad.
--
--
kensmith@rahul.net   forging knowledge
Reply to
Ken Smith

In article , Nico Coesel wrote: [....]

You can reuse the code. If you write good code for an 8051 you can use it on any other 8051. I have a set of routines that have been put into 6 very different products. The standard RS232, 32 bit math, a command line hardware debugger and a huge number of utility routines have been used in each.

You can get 8051 similators for the PC so you really can run the code on a PC. It just runs a little slower than normal. Its sort of like using XP. If you have a 1GHz PC you are not too likely to notice the reduced performance.

--
--
kensmith@rahul.net   forging knowledge
Reply to
Ken Smith

Besides portable code in "C" is largely a myth. Any program that has been ported much will have a lot of "#if" logic in the source to make the different source code you need in different cases. Try porting from a PC to the Analog Devices Shark and back and you will see.

The C language contains many constructs that hard hardware dependant. This is a result of the history of the language. The "int" type varies in the number of bits. The "float" types vary in the range and number of digits. Unfortunately the language does not let you specify the range of integers and the details of floats etc.

--
--
kensmith@rahul.net   forging knowledge
Reply to
Ken Smith

But I learnt that X86 was different from Motorola ?

Reply to
~~ VerilogMan ~~

In article , keith wrote: [...]

For simple programs it may be possible to do but you'd better watch it if you use strings. In some cases it is best to just store one character per integer.

In C you have no choice. All of the types are hardward dependant. The simple types (int, float, and pointers etc) are.

All more complex types such as structures and unions are composed of the simple types. They also can't be passed to subroutines. All complex types are passed as a pointer to the value rather than the value. Pointers are hardware dependant. In some processors, you can't type convert between pointers. This makes any routine that uses the "void *" type of pointer non-portible.

--
--
kensmith@rahul.net   forging knowledge
Reply to
Ken Smith

In article , Rich Grise wrote: [...]

C hasn't changed since the type-checkable proto-types were introduced. If they change anything, old programs will no longer compile. C++ and now "object C" were supposed to be upward compatible improvements over C. Neither has lived up to its hype. Adding objects to C is a good idea but its still C.

--
--
kensmith@rahul.net   forging knowledge
Reply to
Ken Smith

No, I fully understand your point. But you said that the code can't be "reused". I was arguing against that specific point in what you wrote.

I was not suggesesting that the fact that you wanted to run the same code on different machines is a sign of a sick mind. Nor was I questioning the manhood of anyone who doesn't code in assembly. Others may argue such points as whether type checking is leading to laziness and stupidity in programmers or whether software without line numbers can really be called software. I made no such statements in my posting.

--
--
kensmith@rahul.net   forging knowledge
Reply to
Ken Smith

Well the problem is that I already proposed this project... So it's a bit too late for me to go back ! :(

See I just thought that all you neede was the controller and that you had to attach it to the connections of the LCD module ... But apparently I need a board and everything with different composants !! On one side it is good ... I feel like I am learning *a lot* each time I read you guys. But on the other hand I realize the harder it is ! :)

formatting link
on this website this guy has done it for graphic lcds but there is not the touchscreen part So I pretty much discovered that you needed more than just a microcontroller ! I felt like buying what this guy was sellinh and try to adapt it for what I wanted to do ... ButI don't think it is possible

Intel X86

I think I will go with the first choice man ! :)

I do know asm... but I want to use it as less as i can ...

Hey, thanks these websites are amazing.... they even have serial interface.... ! Definitvely my choice is to go with a board now I think. If I have to just do the programming part and not the interfacing, that would be really a big lift from my shoulders. I went on the ATMEGA128 boards page... And these ones looked interesting:

Flexit MB-128-XXX Mega128-Dev-MMC MEGABRAIN128 PROBOmega128 STK 501 Mega128-Net adn all the BD MICRO

Which one do you think is the best ? With my amateur eyes the BDMICRO looks nice and same with the STK501... which one would you ? If you had to make a choice right now ? (that's what I have to do right now :) ! I guess I would want the one with the most support. and price/quality wise ? I think this one

formatting link
is quite good !

Again, thanks for all your help, all of your help is really making me progress quickly!

Reply to
~~ VerilogMan ~~

You are missing my point. If I write a piece of code, I want to be able to use it on another platform (unless it deals with specific hardware ofcourse).

--
Reply to nico@nctdevpuntnl (punt=.)
Bedrijven en winkels vindt U op www.adresboekje.nl
Reply to
Nico Coesel

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.