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.

Nios II help Interfacing Sensors

Status
Not open for further replies.

matthew.m

New Member
Hey guys,
Im new to embedded systems design and just need soe direction on what to do.

What i wanna do is connect and interface sensors to the nios II microprocessor. These sensors include ; temperature sensor, hygrometer , rain gauge , solar radiation , humidity and wind spped/direction (anonemeter) .. These sensors then produce data to be sent to a remote PC

What i know so far is lets say a TM temperature sensor producing an Analog V signal , which in turn will have to provide input to an AC converter. The ACcon then provides an input for the FPGA.

What i'm not getting a hang of is how to interface the sensors with the microprocessor and the technique , the use of interrupts an DMA , data memory storage , reading and writing, and its communication to the PC for user interface. SO basically collecting the data and sending it to a PC and software in C on how to do this is the next step.

Can anyone help me out in detail so i can see the big picture? really am lost in this and definitely need help in detail. Any help would be appreciated

regards
M
 
What i know so far is lets say a TM temperature sensor producing an Analog V signal , which in turn will have to provide input to an AC converter.

Do you mean Analog to digital converter ?

The ACcon then provides an input for the FPGA.

Your requirements should dictate the need for an FPGA such as many I/O or speed, what is your reasoning for an FPGA?

What i'm not getting a hang of is how to interface the sensors with the microprocessor and the technique , the use of interrupts an DMA , data memory storage

Weather events are rather slow, why do you think you need DMA? Each sensor could be channelized with an A to D in a microprocessor. Explain why you think DMA is needed?

Can anyone help me out in detail so i can see the big picture?

You need to give us the big picture of what you are trying to do so we can better assist you.
 
sorry about that correction AD converter. But since there is a need for signal conditioning and need for an external ADC does it make more sense going for a digital thermal sensor with SPI interface? but i still wanna get an idea on how to interface these sensors to the microprocessor to record and display data
 
In a nutshell its going to be an autonomous weather station capable of communicating remotely with a PC user to display recorded data from the station. But the first obstacle I face is interfacing the sensors with the microprocessor and I/O addressing and the best technique to use. Sorry if i seem to be all over with my thoughts , just a bit confused with everything at the moment. =S
 
Just what is a NIOS chip never heard of one.....
 

Attachments

  • the big picture.jpg
    the big picture.jpg
    59.1 KB · Views: 238
Last edited:
Sounds like you could get by with a multi channel A/D micro chip. Microchip company offers many flavors, for example
https://www.electro-tech-online.com/custompdfs/2011/02/30292c.pdf

Your biggest challenge will be signal conditioning and analog interface, this will require much research and testing on your part. A weather station will not require complex digital circuits such as DMA, you need to focus on the analog interface to the sensors.
 
Nios is a "soft" processor that runs in Altera FPGA technology.

@matthew.m. Conversion chips have various interfaces. They can be parallel, SPI, I2C, etc. First order of business is to choose the A/D chip, then we can work on how to interface it to you device. Are you using a development kit?

PS If you use a digital thermo with a SPI interface, then there would be no need for conditioning. That would all be built in.
 
Last edited:
using the altera dev. kit , nios II cyclone II dev. board
Looking at LM-74 with SPI interface or LM-75 temp. sensor with I2C interface... thoughts on the two?

how to interface these with the nios microprocessor?
 
Last edited:
Both are serial interfaces. Are you using SOPC builder with your Nios project? In version 10.0 SP1 that I'm using, there is a plug in module for SPI. I don't see one for I2C. So, you're gonna need a module for which ever protocal you choose. You might also check "opencores.org" I know for sure they will have both interfaces. Be aware that some of their cores have bugs, so simulation migh be a very good idea, especially if they provide a testbench.
 
now looking at getting some experience using the SOPC builder looking over the training videos at altera . I also had acquired a plug in module for SPI . So how to go about interfacing the sensors? How is the digital data read into the processor and displayed as lets say temperature values to the user? My apologies if i may seem somewhat slow , but its my first time working at something like this , seems to be a fun ,worthwhile and tremendous experience though.
 
Read Chapter 8 of this. When you generate your SOPC, you'll be given a system register map. That tells you what the offset address for each module in your system. To address the SPI registers, you just add the register address to the offset from the system register map. So, use the registers to set up your interface and read/write the 32-bit data registers. Sorry to leave you with all that reading, but it's just the pain a developer must go through :)

PS: Altera allows a developer to use the IP from SOPC "unliscensed" under certain restrictions. See their website for more details.
 
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top