• AVR Freaks

Helpful ReplyHot!Newbie to Microchip - Need urgent help

Author
melvinpmathew
New Member
  • Total Posts : 21
  • Reward points : 0
  • Joined: 2020/03/19 08:25:06
  • Location: 0
  • Status: offline
2020/04/16 07:51:16 (permalink)
0

Newbie to Microchip - Need urgent help

Hi Guys,
 
Need some guidance to get a simple helloworld project , with console output working.
 
I have a dev board MCLV-2 with dsPIC33EP512GM706 chipset. Tried flashing a simple helloworld program and it does not show anything in console. The IDE(MPLABXIDE v5.35) says that the program has been flashed and verified, but there is not response to show if its working.
 
-Using ICD4 debugger-
Also, not able to debug, the error response is :
 
Fatal error: 0xc04
The target device is not ready for debugging. Please check your configuration bit settings and program the device before proceeding. The most common causes for this failure are oscillator and/or PGC/PGD settings.
 
Please let me know how to proceed, just wanted to do a POC for a new project.
post edited by melvinpmathew - 2020/04/16 08:49:24
#1
NKurzman
A Guy on the Net
  • Total Posts : 18858
  • Reward points : 0
  • Joined: 2008/01/16 19:33:48
  • Location: 0
  • Status: online
Re: Newbie to Microchip - Need urgent help 2020/04/16 09:07:31 (permalink) ☄ Helpfulby melvinpmathew 2020/04/17 07:06:26
+4 (4)
Please check your configuration bit settings and program the device before proceeding. The most common causes for this failure are oscillator and/or PGC/PGD settings.
 
which set of PGC/PGD pins is your debugger connected to?
Which set did you tell it to use in Config settings?
Also you would need to use the Config settings to say where you oscillator is.
 
#2
Bob White
Super Member
  • Total Posts : 336
  • Reward points : 0
  • Joined: 2010/11/06 19:52:38
  • Location: Denver, Colorado
  • Status: offline
Re: Newbie to Microchip - Need urgent help 2020/04/16 09:49:39 (permalink)
+2 (2)
What do you mean by "console"?
#3
melvinpmathew
New Member
  • Total Posts : 21
  • Reward points : 0
  • Joined: 2020/03/19 08:25:06
  • Location: 0
  • Status: offline
Re: Newbie to Microchip - Need urgent help 2020/04/16 14:16:52 (permalink)
0
Thanks for all the reply. Okay, got the first issue resolved by setting 
 
#pragma config ICS = PGD2               // ICD Communication Channel Select bits (Communicate on PGEC2 and PGED2)
 
Able to flash/debug the program correctly. But printf() still not outputting to console\ MPLab data Visualizer terminal\ Console terminal , using usb COM port on the development board
 
#4
Aussie Susan
Super Member
  • Total Posts : 3737
  • Reward points : 0
  • Joined: 2008/08/18 22:20:40
  • Location: Melbourne, Australia
  • Status: offline
Re: Newbie to Microchip - Need urgent help 2020/04/16 19:35:21 (permalink) ☄ Helpfulby melvinpmathew 2020/04/17 07:06:21
+1 (1)
Have you read up on how to direct the printf function output? You need to set up a UART for it and write a function that will pass each character generated to the UART - it is all explained in the XC16 User Guide.
What I suspect you are expecting is to have the characters appear somewhere within the IDE - not with the Microchip environment.
Susan
#5
melvinpmathew
New Member
  • Total Posts : 21
  • Reward points : 0
  • Joined: 2020/03/19 08:25:06
  • Location: 0
  • Status: offline
Re: Newbie to Microchip - Need urgent help 2020/04/20 07:47:38 (permalink)
0
Thanks Aussie for the response. I have been trying to use MCC- Code configurator to get the printf redirect working - not working as expected till now. Trying to setup BOARD<->PC(USB)<->DE console output.
#6
dan1138
Super Member
  • Total Posts : 3731
  • Reward points : 0
  • Joined: 2007/02/21 23:04:16
  • Location: 0
  • Status: offline
Re: Newbie to Microchip - Need urgent help 2020/04/20 10:29:36 (permalink)
+1 (1)
melvinpmathew
Thanks Aussie for the response. I have been trying to use MCC- Code configurator to get the printf redirect working - not working as expected till now. Trying to setup BOARD<->PC(USB)<->DE console output.

I think the MPLABX supports a debug console within the IDE only for the 32-bit devices.
 
Redirecting the printf output to physical hardware like a UART or LCD module seems more involved. So do as Aussie Susan suggests and read the XC16 user guide. and look at the example project dspic33ep512gm710_pim.x in the Explorer 16/32 Board Demo Code on the Microchip web site.
post edited by dan1138 - 2020/04/27 19:13:31
#7
RISC
Super Member
  • Total Posts : 5776
  • Reward points : 0
  • Status: offline
Re: Newbie to Microchip - Need urgent help 2020/04/20 14:54:04 (permalink)
+1 (1)
Hi,
If you use MCC, you can redirect STDIO to a UART by just checking one box in the graphical configuration from the UART. I believe dspic33ep512gm710 is supported in MCC.
Regards
#8
melvinpmathew
New Member
  • Total Posts : 21
  • Reward points : 0
  • Joined: 2020/03/19 08:25:06
  • Location: 0
  • Status: offline
Re: Newbie to Microchip - Need urgent help 2020/04/27 13:48:25 (permalink)
+1 (1)
Thanks all for the reply. Got the printf redirect working. Used MCC, assigned the pins to UART, also enabled the checkbox to redirect and worked like magic. 16-bit devices are supported, just have to configure them correctly. Used the 64-100pin mapping for configuring the pins.
#9
PStechPaul
Super Member
  • Total Posts : 2814
  • Reward points : 0
  • Joined: 2006/06/27 16:11:32
  • Location: Cockeysville, MD, USA
  • Status: offline
Re: Newbie to Microchip - Need urgent help 2020/04/27 18:33:57 (permalink)
+1 (1)
It would seem to be a fairly easy task for the simulator to detect the TX interrupt and copy the contents of the TXD register to an output window. But there must be some reason why this hasn't be done. I've asked about it before.

 
#10
melvinpmathew
New Member
  • Total Posts : 21
  • Reward points : 0
  • Joined: 2020/03/19 08:25:06
  • Location: 0
  • Status: offline
Re: Newbie to Microchip - Need urgent help 2020/07/02 07:33:59 (permalink)
0
Yes @PStechPaul. I agree with you! This is the first IDE i have worked with that - so much effort need to be added for a printf redirect.
#11
Jump to:
© 2020 APG vNext Commercial Version 4.5