dsPIC blockset for MATLAB/Simulink

Hi,

I am a final year masters student studying Aerospace Systems Engineering the the University of the West of England.  I am currently using the UDB V3 for my final year thesis in order to develop a flight controller for a small UAV.

I do not know C, therefore I have opted to use the dsPIC blockset from Microchip (http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en538347) in order to program my UDB.  However, I am having some troubles and am wondering if anyone has any experience in this and could help me to find where I am going wrong.

I am trying to read the value for the Z acceleration from the ADC and output this information over RS232 using the UART for calibration purposes. I have got the UART set up correctly as I can send information through this and pick it up in hyperterminal just fine.  My problem is however when I try to read from the ADC and output this via the UART, I recieve nothing in hyperterminal at all.  Since I have never done anything like this before, I am not totally sure what all the settings for the ADC Config and ADC Read blocks even mean, let alone whether or not I have configured it correctly (which I am guessing I haven't since I am not getting any information).  I have attached screenshots of the configuration of these two blocks.

I would be very grateful if someone could point me in the right direction as I am running out of time to finish this project.

Thanks,

Ryan

adc_config.png

adc_read.png

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Replies

  • I've never used Matlab this way before! But it's quite interesting, I'm gonna download the module and see if I can give you any help.

    Have you tried to put some debug code together with the ADC sampling? To see if the program runs or not, and if and where is the problem (if the routine gets stuck, or if it does nothing, or anything else).

     

    Never mind.

    Guess that for 1500€ you'd better learn C, it's not that difficult...

     

    In the configuration window try these

    -tick ADC Sample Auto-Start

    -Auto Sample Time put in 10 TADs or something

    -you selected 10bit - 4 channel operation but then asked for channel 8 to be fetched. I guess there's something wrong with the configuration.

This reply was deleted.

Activity

Neville Rodrigues liked Neville Rodrigues's profile
Jun 30
Santiago Perez liked Santiago Perez's profile
Jun 21
More…