Page 1 of 1

circuit interface between MATLAB and dsPIC?

Posted: Sun Feb 24, 2008 5:09 pm
by Kiara
hello sir,

I have emailed you before asking about your work and my project (ref : Intan).

I am very very new with dsPIC and I don't know much about dsPIC and would very much appreciate it if you could help me with all my questions, even though it is very basic.

My question is, how do you connect from MATLAB to dsPIC? do you need to have a circuit interface or buffer between them? I am very puzzle to how am I connecting this both together.

Thank you

Re: circuit interface between MATLAB and dsPIC?

Posted: Mon Feb 25, 2008 10:53 pm
by LubinKerhuel
Hi Kiara,

Are you talking about
- a connection to upload the .hex file into the dsPIC ?
- a connection to get and plot data in real time through UART and COM port on the computer ? (send data is also possible)

Re: circuit interface between MATLAB and dsPIC?

Posted: Wed Apr 23, 2008 12:30 pm
by chukhivuitinh
a connection to upload the .hex file into the dsPIC ? <<< use tiny bootloader with 5 pin MCLR ,VDD ,GND ,TX ,RX wright ?
a connection to get and plot data in real time through UART and COM port on the computer ? <<< ^_^ :?: :?: :?:

Re: circuit interface between MATLAB and dsPIC?

Posted: Thu Apr 24, 2008 11:15 pm
by LubinKerhuel
chukhivuitinh wrote:a connection to upload the .hex file into the dsPIC ? <<< use tiny bootloader with 5 pin MCLR ,VDD ,GND ,TX ,RX right ?
:? More or less true:
If you use a boot loader (like tinybld ; google it !) you need first to program your chip with the bootloader soft. To do so, you will have to buy a programmer (I2C, real ice or others...), or build yourself a programmer for PIC, many schematic are available on the web, some of them are very simple.

Once the bootloader code is loaded into the chip, you will be able to load a program in the chip using the UART interface: GND ,Tx, Rx + the chip must be running.
Programming the chip will not erase the bootloader, check how the used bootloader you use is working...
chukhivuitinh wrote:a connection to get and plot data in real time through UART and COM port on the computer
This will use the same UART interface as the one used by the bootloader : GND ,Tx, Rx + the chip must be running.

Note however that some bootloader may use others interface than the UART.

Important: for the UART interface, you need to translate the signal level: COM port of your PC signals are between +-15 or +-3V. The COM port of the chip is between [0-Vdd] with vdd usually fixed in [3.3V ; 5V]
The "traditional" electronic part to use is max232, but more recent component is even easier: look at DS276 component from maxim.

Lubin

Re: circuit interface between MATLAB and dsPIC?

Posted: Tue Feb 02, 2010 4:58 pm
by onuruygur
Hello all,

I am not sure that my question is related with this topic but didn't want to create an improper new subject,



I just received my lite FLEX dspic board. I have MPLAB 8.3 installed. I also have bought a ICD2.

I have prepared a .hex file in SIMULINK, imported it to MPLAB. After I connect & installed ICD2 in MPLAB it warned me to upgrade the ICD2 operating system to DSPIC33FJ256MC710 (I had choosed it first from the tools>select device). It succesfully upgraded the operating system.

Here is some strange starts:
:shock:
When i click program form the programmer menu it firstly:

"ICDWarn0052 : ICD2 cannot validate a target device..."

and when i click OK:
"ICDWarn0064: The requested operation will destroy the Boot segment already defined on the target. You must explicitly specify that ICD is allowed to do this on the Secure Segment tab of the MPLAB ICD 2 Settings Page. "

Ok there are settings on secure segment tab but i am not sure about overwriting the boot segment.

Which is the right segment for MPLAB / ICD2 & Lite Flex board programming if you just want to program a blinking led example?

Regards,

Re: circuit interface between MATLAB and dsPIC?

Posted: Tue Feb 02, 2010 6:21 pm
by onuruygur
Ok people i coudn't wait anymore and click FULL PROGRAMMING after i read:

http://209.85.229.132/search?q=cache:yg ... clnk&gl=tr

RESULT : It works! My led is now blinking... :lol:

Now i can turn to my control model...

Thnxs,