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.

advice on a microcontroller board (and an interface)

Status
Not open for further replies.

sknoogleplex

New Member
Hi, I'm a student working on a project where I need to code everything in assembly and cannot use an OS or libraries. (I.e. I need to code _everything_.) The amount of code I write needs to be absolutely minimal. (Each unnecessary line should be avoided for the project to be successful.)

The summarized I/O requirements of my finished system are:
-I need to be able to do basic r/w to about 1MB of some type of external, non-volatile memory.
-I need two RS-232 connectors. (One for screen output, one to talk to a smart card reader. Should have corresponding UARTs, of course.)
-I need to be able to play basic sounds out of a speaker (i.e. some kind of analog output).
-3 basic buttons or more.

First, is there any interface anyone would recommend for the readable/writeable, external storage (since I need to manually communicate with it using a very small amount of code). Is SPI the best?

More importantly, can anyone recommend a microcontroller board that might suit this purpose.

Let me know if you'd like any more details or have questions.

Thank you very much. -Ryan
 
Last edited:
-I need to be able to do basic r/w to about 1MB of some type of external, non-volatile memory.

First, is there any interface anyone would recommend for the readable/writeable, external storage (since I need to manually communicate with it using a very small amount of code). Is SPI the best?
Why not use SD. Cards are cheap ($6 or so for 2GB). They can interface to a MCU using ultra-simple SPI. The code is not terribly difficult. For what you're doing you probably don't need to do a full-on FAT system. Just write and read the card raw.


-I need two RS-232 connectors. (One for screen output, one to talk to a smart card reader. Should have corresponding UARTs, of course.)
-I need to be able to play basic sounds out of a speaker (i.e. some kind of analog output).

More importantly, can anyone recommend a microcontroller board that might suit this purpose.
There are tons of them that might work. I'm working with **broken link removed**, though it might be tougher to program in assembler than something like a PIC or AVR. Even has an SD card slot.

You don't need a programmer/debugger, though that makes things nicer/easier. The LPC2000 line all have bootloaders, so just plug a serial cable in and you're in business.

ARMs can be programmed in asm, but are really more suited to programming in C. Why the restriction to asm? You can use C without libs. Just write your own functions. I'm not knocking asm. I love asm, but C is just so much easier and quicker to bang out code with.
 
You have no answer because this is a strange thing to dump on a student.

In addition we do not know anything about what you have learned so far.

The request is impossible to answer well.

3v0

It's something I need to do. The reason for the very small amount of code is that the application of the device I'm making is security critical. Even small amounts of code are difficult to audit for security bugs. I'm hoping to be able to code the whole system in about 900 instructions or less. (Not including data.) The reasons for not wanting an OS, libraries, compiler, etc. is the same. Those should all be audited for security vulnerabilities or malicious code as well if they are used.

You can assume I know everything I need to know to do this. I'll keep digging as I go. Right now, I'm just trying to find hardware that is capable of meeting the needs. The next step will be making it work.
 
Why not use SD. Cards are cheap ($6 or so for 2GB). They can interface to a MCU using ultra-simple SPI. The code is not terribly difficult. For what you're doing you probably don't need to do a full-on FAT system. Just write and read the card raw.

Yeah, that's right. I don't need a filesystem. Raw writing is perfect. If SPI is simple, that's great. That's what I'll do. Thank you!


There are tons of them that might work. I'm working with **broken link removed**, though it might be tougher to program in assembler than something like a PIC or AVR. Even has an SD card slot.

Why might it be tougher? Do you know which instruction set might yield less code?

Thanks a lot for recommending the board. Is there a way you could hook a speaker up to it? I'm assuming the buzzer just buzzes? (I need to play basic wav files.) Would you google for anything in particular to find a board like that? My problem is that there are so many boards out there, I'm not hitting ones that do what I need.

Also, do you know if there is any way of adding a button or two? I need about 3.

You don't need a programmer/debugger, though that makes things nicer/easier. The LPC2000 line all have bootloaders, so just plug a serial cable in and you're in business.

ARMs can be programmed in asm, but are really more suited to programming in C. Why the restriction to asm? You can use C without libs. Just write your own functions. I'm not knocking asm. I love asm, but C is just so much easier and quicker to bang out code with.

Since the application of this board (electronic voting) is very security critical, we need to avoid dependence on a compiler since malicious backdoors can potentially be inserted into the compiler.

Thanks again.
 
Hi, I'm a student working on a project where I need to code everything in assembly and cannot use an OS or libraries. (I.e. I need to code _everything_.) The amount of code I write needs to be absolutely minimal. (Each unnecessary line should be avoided for the project to be successful.)

The summarized I/O requirements of my finished system are:
-I need to be able to do basic r/w to about 1MB of some type of external, non-volatile memory.
-I need two RS-232 connectors. (One for screen output, one to talk to a smart card reader. Should have corresponding UARTs, of course.)
-I need to be able to play basic sounds out of a speaker (i.e. some kind of analog output).
-3 basic buttons or more.

First, is there any interface anyone would recommend for the readable/writeable, external storage (since I need to manually communicate with it using a very small amount of code). Is SPI the best?

More importantly, can anyone recommend a microcontroller board that might suit this purpose.

Let me know if you'd like any more details or have questions.

Thank you very much. -Ryan

PIC32 is the best thing for your project. **broken link removed**

Get an adapter board to solder the chip on and break out the pins: Sockets - SMD Adapters <-- buy the last one on that page

I made a thread on how to prototype with PIC32: https://www.electro-tech-online.com/threads/prototyping-with-pic32.87995/
 
This project doesn't sound like it needs the raw horsepower on a 100pin TQFP (no fun to hand solder)
There are many simpler 8 bit micros well up to the task.
 
Thanks. I have about 2 months to finish, so although it would be fun (an easier to get what I want), I think I'd like to avoid messing around with hardware as much as possible.

I'm leaning toward the board that was first recommended and attaching an amp with a stereo jack. Why do you think the PIC is preferrable to the ARM? How critical do you think that is?
 
Last edited:
Two months to including hardware, PCB, programming? You don't even know what mpu you're going to use. Unless you're a crack hardware / firmware engineer you're not likely to complete it on time.

PIC, AVR, Arm it's your choice to make. What programmer / debugger do you have?
 
Last edited:
Wow talk about restrictions. Generally only the most basic tools run under linux. I'm not familiar with AVR so it may have an IDE for Linux but with most toolsuites they run best with Windows.
 
Why might it be tougher? Do you know which instruction set might yield less code?
I've never programmed an ARM in asm. I hear they can be a bit complex. They certainly are in C. These are 32-bit processors and , for your purposes, are probably way overkill. But they aren't expensive and there's plenty of capacity to grow. They have LOTS of memory and peripherals.

I would think a larger 8-bit PIC or AVR would be more than adequate too. Asm code is pretty simple for them.

Is there a way you could hook a speaker up to it? I'm assuming the buzzer just buzzes? (I need to play basic wav files.)
It's a piezo transducer. I've never tried doing anything but beeps, but I think it could do sound just fine. You wouldn't get much low end out of it, but piezo's are used as tweeters in stereo speakers all the time.

If that doesn't cut it, the LPC2148 has a DAC. Add a simple amplifier chip & circuit and a speaker and you're in business. :p

Also, do you know if there is any way of adding a button or two? I need about 3.
The LPC-P2148 board has two buttons. You could solder wires to them to get remote buttons and/or use some of the free pins to add buttons. Doing that is very simple.
 
Last edited:
I'm not sure yet. I'll be developing in a linux environment. Do you have any recommendations?

Then the Phillips ARM board which you linked to IS a great choice. Like Futz said, you won't need a programmer to load your firmware.

I think your fears:
Since the application of this board (electronic voting) is very security critical, we need to avoid dependence on a compiler since malicious backdoors can potentially be inserted into the compiler.
are unfounded. You aren't putting the compiler on the chip, and a compiler produces the SAME type of file that an assembler does. Also, once you burn your firmware you can read protect it. The gcc compiler, which is already in your Linux distro. can work very well for this. What Futz just said about assembler on the ARM; it isn't for the faint of heart!

EDIT: The only PICs I know with 2 UARTs come in TQFP, but you could get a prototyping board with one mounted - similar to the LPC...
 
Last edited:
I think your fears:
are unfounded. You aren't putting the compiler on the chip, and a compiler produces the SAME type of file that an assembler does. Also, once you burn your firmware you can read protect it. The gcc compiler, which is already in your Linux distro. can work very well for this.
I very much doubt any malicious back door code would survive for more than a microsecond in the open source world. There are some majorly smart people who use and maintain that compiler every day. They would definitely find and kill such a thing immediately if it ever managed to get put in the code in the first place (it would never make it that far), and go after whoever wrote the code. What I'm trying to say is, it just wouldn't happen. The compiler can be trusted.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top