Page 4 of 4

Re: PIC24FJ512GA606 download error!

Posted: Mon Jan 17, 2022 3:42 am
by seokgi
Hello?

I have many problems.

When will the problem of no digital output from MCU be resolved?

thank you.

Re: PIC24FJ512GA606 download error!

Posted: Thu Feb 03, 2022 4:48 am
by seokgi
Hello.
I put a lot of effort into it.
So some ports work. However, some ports do not work.
Looks like I'll have to manipulate the registers.
But I can't do it.
I would like to know how to control each pin as input and output by controlling a register with C Code.
Help.
Thank you.

Re: PIC24FJ512GA606 download error!

Posted: Thu Feb 03, 2022 9:49 am
by BenR
Hello,

To set a pin as an output you do something like this.

Code: Select all

TRISAbits.TRISA0 = 0;  //Set Port A pin 0 as an Output
LATAbits.LATA0 = 1;     //Set Port A pin 0 high
Or you can use the FC output icon.


To set a pin as an input you do something like this.

Code: Select all

TRISAbits.TRISA0 = 1;  //Set Port A pin 0 as an Input - Default state on power up
FCV_VAR = PORTAbits.RA0;  //Read Port A pin 0 into Flowcode global variable var
Or you can use the FC input icon.


Which pins aren't working and is it an output or an input that isn't working? The ANSEL registers can sometimes effect digital inputs and they are generally on by default but Flowcode should disable them for all ports. I'll double check this is correct for your target device.


edit: this is the current startup code that gets included at the top of main to disable the ANSEL registers, Are we missing a port?

Code: Select all

ANSB=0x00;
ANSC=0x00;
ANSD=0x00;
ANSE=0x00;
ANSG=0x00;

Re: PIC24FJ512GA606 download error!

Posted: Fri Feb 04, 2022 7:32 am
by seokgi
Thank you for your interest and consideration.
The MCU works almost normally.
However, some pins are not normal.
I want to output to RB13. But it doesn't work.
More advice please.
Thank you.

Re: PIC24FJ512GA606 download error!

Posted: Fri Feb 04, 2022 12:45 pm
by BenR
Pin B13 is a JTAG pin, do you have JTAG debugging enabled in your configuration settings?

Re: PIC24FJ512GA606 download error!

Posted: Mon Feb 14, 2022 6:34 am
by seokgi
Hello
Thanks for your help, the project is going well.
However, the interrupt does not proceed.
And how do I set the IOC Port?
What is the meaning of red black green in the picture?
How do I set it up?

Thank you for your help as always.

Re: PIC24FJ512GA606 download error!

Posted: Mon Feb 14, 2022 8:26 am
by medelec35
Hi.
seokgi wrote:
Mon Feb 14, 2022 6:34 am
What is the meaning of red black green in the picture?
It looks like there is a bug in the dark theme as the font is changed to white on a white background.
If you change to the light theme it will show you:
IOC Key.png
IOC Key.png (27.27 KiB) Viewed 2437 times
Not all microcontrollers allow you to have control on both rising and falling edges.
To change the state of each pin you will need to click in the actual pin.
Change pin state.png
Change pin state.png (1.81 KiB) Viewed 2437 times
Unfortunately, all the pins are enabled by default and currently, if there are a lot of pins, you will need to unselect all not going to be used.
Otherwise floating pins could cause IOC ISR triggering.

Edit: Issues have been reported.

Re: PIC24FJ512GA606 download error!

Posted: Mon Feb 14, 2022 12:19 pm
by seokgi
Thanks for your help.
FC9 is set to Light Mode. The text on the screen looks fine.
However, Trigger on Rising (RED) is not set. I want to set RD0(INT0), RD11(Remap INT1) to Trigger on Rising. Interrupt does not work.
thank you.