Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++

FPGA and Microcontroller

Altera_Forum
Honored Contributor II
1,057 Views

I have been working on a college project to develop a training kit that is able to help students to learn NIOS boards using VHDL language.. i chose to develop a board that extends the usage of NIOS boards to serial data transfer (basically communication of NIOS with another device) and eventually ended up developing a board based on a temperature sensor from DALLAS ... DS1820.. 

 

Now, this sensor was fairly common in microcontroller areas where it was often used to perform accurate temperature sensing... the problem that i faced is that i was unable to generate a signal that resembles that of a microcontroller... 

what i wanted to know was ... can fpga be described to perform like a microcontroller? 

 

Please do correct me if i am wrong, but what i learn was that the roots of microcontroller are still logic gates... so again if i am correct, FPGA should be able to do what i microcontroller can? am i right? 

 

If i am able to describe the FPGA to behave like a microcontroller... can i write assembly instructions and download it to the FPGA-microcontroller and expect it to run like as though the sensor was operating with a microcontroller... 

honestly i haven't the most vague idea s to where i should start... please advise accordingly and i thank you for the time ... thanks
0 Kudos
3 Replies
Altera_Forum
Honored Contributor II
337 Views

NIOS is the micro-controller. The DallasSemi device is a One-Wire part. You access the sensor using either software with a PIO or you can build a state-machine implemented in the FPGA using VHDL or Verilog. 

 

To use software, add a one (1) bit Bidirectional PIO device to the NIOS using SOPC. Connect its single output pin to the pin of the sensor. Software controls the output level, if it is driving or tri-state mode, and can read the pin for getting the data from the sensor. The program can be written in C, Assembly, Forth, etc. I've done several different protocols in the last few years. You will need to follow the sensor's protocol closely to get the temperature value from the sensor as well as the other bit fields in the part.
0 Kudos
Altera_Forum
Honored Contributor II
337 Views

 

--- Quote Start ---  

originally posted by l.robinson@Feb 27 2007, 12:51 PM 

nios is the micro-controller.  the dallassemi device is a one-wire part.  you access the sensor using either software with a pio or you can build a state-machine implemented in the fpga using vhdl or verilog. 

 

to use software, add a one (1) bit bidirectional pio device to the nios using sopc. connect its single output pin to the pin of the sensor.  software controls the output level, if it is driving or tri-state mode, and can read the pin for getting the data from the sensor.  the program can be written in c, assembly, forth, etc.  i've done several different protocols in the last few years. you will need to follow the sensor's protocol closely to get the temperature value from the sensor as well as the other bit fields in the part. 

<div align='right'><{post_snapback}> (index.php?act=findpost&pid=21897) 

--- quote end ---  

 

--- Quote End ---  

 

 

thanks for the reply, thanks... i still haven&#39;t get the whole idea... 

I have learned state machines.. but i was never taught of how to implement state machines from devices like this ... is there any exampls that i can refer to 

 

 

secondly .... should i use c language or VHDL? 

 

 

best of regards.
0 Kudos
Altera_Forum
Honored Contributor II
337 Views

You can find implementation of state machine in QuartusII Handbook. Moreover, there is a template of state machine in Quartus! Create new Verilog file, click Edit, then Insert template...

0 Kudos
Reply