1
\$\begingroup\$

I am sending some values through a serial port from the dsPIC30F4011 to matlab. When the ICD3 is connected and I am working in debugger mode, the values are sent and received perfectly as expected. When I program the dsPIC and remove the ICD3, the serial is not working anymore. So I guess my question is, what changes between debugger mode and programmer?

\$\endgroup\$
1
\$\begingroup\$

I think we need more information to be able to help you find why you are not reading data from Matlab. But first, the answer to your question

what changes between debugger mode and programmer?

There are a few things that are different, none of which I would think is affecting you being able to read data in Matlab. The main difference is that when you change to programmer mode, you are not able to stop the program in mid-execution, that is you download the HEX to your dsPIC and then there is no more interaction. In debugger mode you can set breakpoints and step through the execution of the HEX, look at the contents of registers, etc. Apart from that, the program should behave exactly the same.

Here are a couple of things I would check 1.- When you mean "remove de ICD3" I interpret that you unplug it. If that is the case, then make sure you have a common ground. It might be that you do not share a ground with you PC, which was there when you had the ICD but not anymore.

2.- Make sure that there is no overrun in such a way that when you step through the dsPIC is able to keep up but when it is in "free run" it just gets overloaded.

Hope this helps

\$\endgroup\$
1
  • \$\begingroup\$ How can i make sure there is no overrun? Our serial is grounded. \$\endgroup\$ May 9 '12 at 14:59
0
\$\begingroup\$

By your description, I would guess that you're using DMCI to serially transmit variables from the dsPIC to the ICD3 without actually coding a UART.

This requires the project to be in debug mode, as the debugger is playing a role in the DMCI (the HEX file that's generated is also different from normal release mode, as some modifications have to be made to facilitate this debugging.)

When you configure the ICD3 as a programmer, there is no DMCI capability. You should also notice that the project switches from 'debug' to 'release'.

If you want to be able to see variables in release-mode firmware, you'll need to code a UART and code the transmission of the values you want to see.

\$\endgroup\$
1
  • \$\begingroup\$ Problem is figured out. I was reading digital signals from encoders, but i forgot to declare the port as digital. In debugger mode, i guess the ICD3 assumes that the ports are digital. But in programmer mode, the calculations were going all wrong. When i declared the port as digital input, it started functioning properly. Thanks guys \$\endgroup\$ May 9 '12 at 19:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.