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.

Microcontroller for sensor hub

Status
Not open for further replies.

embeddedlover

Full Member level 5
Joined
Aug 10, 2007
Messages
277
Helped
46
Reputation
92
Reaction score
38
Trophy points
1,308
Activity points
3,155
Hi all,

I am working on sensor hub. I wanted to select a micro controller for my application.

The following are the requirements for micro controller:

1. Low-power
2. Serial port for programming and debug (can't afford costly debug tools :cry:)
3. I2C or SPI or SMBus interface (at least 1 of them)
4. Speed not a big concern

The main application of this micro controller is to collect various sensor data and report over to central unit. There can be around 5-10 sensors connected.
I also wanted to know how much flash is approximately required for this? Can someone also tell me how to determine flash size requirement based on application.
 

i suggest to use an small AVR (ATmega328) or a PIC(PIC18F252).
-both ar low power (but it depends on the max frequency you will need)
- i think you need a microcontroller with bootloader capabilities (most AVR and PICs have that over USART) so you need to program just once and the use the bootloader inside the microcontroller to program the flash memory (via a RS232 port).
- both have I2C and/or SPI (in AVR they are separated, and I2c is know as TWI, in pic you have a MCCP for both tasks) mmmm i think you can use an I2C port as SMBus, but i'm not sure about that part.
- AVR and a PIC18 with PLL-enabled are very quick (10M to 16Mips) but if you need very-low power requirements you can slow it at your own pace.


mmmm maybe I could suggest to use a USB capable microcontroller like a PIC18f4550 or an AT90USB1287... you can program them with an USB bootloader and after that program and comunicate with them via USB. but remember a USB cable can't be too long (like 5 meters no more)

also remember that an I2c sensor can't be too far from the microcontroller... it's mostly for in-pcb communication, same for SPI and SMbus (as far as i remember about smbus) in case to place your sensors far away, i suggest the RS485 communication... so you need a microcontroller with at least one USART...
 
Thanks for your reply.

both have I2C and/or SPI (in AVR they are separated, and I2c is know as TWI, in pic you have a MCCP for both tasks) mmmm i think you can use an I2C port as SMBus, but i'm not sure about that part.

one I2C port will work fine for me,

i suggest to use an small AVR (ATmega328) or a PIC(PIC18F252).
-both ar low power (but it depends on the max frequency you will need)

PIC18F series seems fine for me. Less number of interfaces and size.

- i think you need a microcontroller with bootloader capabilities (most AVR and PICs have that over USART) so you need to program just once and the use the bootloader inside the microcontroller to program the flash memory (via a RS232 port).

I am not that familiar with bootloader code. Is it like i have to intially load this code and then only my uart will be usable for porgramming?

mmmm maybe I could suggest to use a USB capable microcontroller like a PIC18f4550 or an AT90USB1287... you can program them with an USB bootloader and after that program and comunicate with them via USB. but remember a USB cable can't be too long (like 5 meters no more)

I would like to have micro controller with 32KB flash or more. In this aspect also PIC18F252 works fine for me. Cost wise this seems preferable. But what advantage do we get with USB bootloader and loading comparabale with programming via UART except speed?

so you need a microcontroller with at least one USART...

PIC18F series is ok for me
 

I am not that familiar with bootloader code. Is it like i have to intially load this code and then only my uart will be usable for porgramming?



I would like to have micro controller with 32KB flash or more. In this aspect also PIC18F252 works fine for me. Cost wise this seems preferable. But what advantage do we get with USB bootloader and loading comparabale with programming via UART except speed?

so you liked the PIC way...
first, one advantage with USB over RS232 is that it's faster, most PC nowadays have USB ports and not a single RS232 port. then, i'm not sure but a USB microcontroller like the PIC18f2550 is a little more expensive than a PIC18f252, but you should check both prices..
then also, programming to use a USB communication is more difficult than programming a RS232-USART communication.... then also, a USART communication could reach more distance than USB, even if you switch from RS232 to RS485 you could get 1000m of distance between your PC and your microcontroller...

as i said, if your distance is not an issue i would go the USB way...


now, a bootloader is a small program that you should program ONCE in your microcontroller (for that once time you need an external programmer, maybe you can borrow it or something like that...), and then you could use an existing communication port (or USB or USART) to re program the rest of the flash memory...

microchip got in ther appnotes some examples of bootloaders, both on USART and USB versions. (i remember the USB mpusb bootloader eats 4KB of flash memory, and the USB HID bootloader eats 8KB of memory (or something like that) any USART bootloader is far smaller than that...)

also don't forget that you can get a programmer: PICKIT or a PICKIT clone (both v2 or v3) for less than 50USD and you don't loose any flash memory to the bootloader... y hope you consider both options: small programmer vs internal bootloader

could you post some information about which sensors do you like to connect? i think you are still deciding between I2C or SPI? maybe we can take a look.
 
Thanks again!!!!

The application involves trapping the analog parameters in a vehicle. Decided to use digital ICs rather than traditional ADC way for accurate results... And we wanted to choose digital ics with I2C interface.

50USD is affordable... Will have a look at it....
 

Hi Kurenai_ryu,

Finally, decide to use PIC18F26K20 for my application after some study...
I decided to use 64K flash for my application... Can you please tell me will this be sufficient or it is an over-kill?

As i have explained my application involves I2C communication on either side.
 

well, it's your choice, you can make a complete I2C setup, and communication in less than 1K of flash with the MSSP but you need to take in account: extra works/calcs, PC communication (i think 1k raw data Tx/Rx, 2~10k complete terminal and/or protocol) and Data buffer requirements (ram needed for sensors! that's important too!) of course 64K will be enough for all of this.

Now, don't forget that the device you have chosen is a 3.3V device.
 
Thanks a lot for the information...

sorry was responding late...
I have gone through datasheet and it says 1.8V-3.6V.. am i missing something?
 

maybe no, but most I2C devices i know, works with 5V not 3.3V,

just make sure all your i2c devices work with 3.3V and you will be ok.
 
Thanks Kurenai_ryu for the information,

I will take care of the levels for sure... If u have worked on low cost sensors can you suggest any? just in case sometimes someone may suggest better than what we do.
 

well, i worked with the DS1621 i2c temperature sensor, and the PCF8591 ADC for generic stuff, (pretty lame i know)
which data do you need? (temperature? pressure? level?)
 

I already have a temperature sensor...
I could get the pressure and liquid level sensors.

I wanted to know if there are any smoke sensors with I2C interface.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top