PIC24FJ512GA606 download error!

For general Flowcode discussion that does not belong in the other sections.
seokgi
Posts: 164
http://meble-kuchenne.info.pl
Joined: Thu Dec 03, 2020 1:43 pm
Has thanked: 5 times
Been thanked: 6 times

Re: PIC24FJ512GA606 download error!

Post by seokgi »

Hello?

I have many problems.

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

thank you.

seokgi
Posts: 164
Joined: Thu Dec 03, 2020 1:43 pm
Has thanked: 5 times
Been thanked: 6 times

Re: PIC24FJ512GA606 download error!

Post 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.

BenR
Matrix Staff
Posts: 1706
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 435 times
Been thanked: 598 times

Re: PIC24FJ512GA606 download error!

Post 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;

seokgi
Posts: 164
Joined: Thu Dec 03, 2020 1:43 pm
Has thanked: 5 times
Been thanked: 6 times

Re: PIC24FJ512GA606 download error!

Post 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.
Attachments
K-001.png
K-001.png (119.04 KiB) Viewed 2447 times

BenR
Matrix Staff
Posts: 1706
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 435 times
Been thanked: 598 times

Re: PIC24FJ512GA606 download error!

Post by BenR »

Pin B13 is a JTAG pin, do you have JTAG debugging enabled in your configuration settings?

seokgi
Posts: 164
Joined: Thu Dec 03, 2020 1:43 pm
Has thanked: 5 times
Been thanked: 6 times

Re: PIC24FJ512GA606 download error!

Post 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.
Attachments
K-001.png
K-001.png (24.94 KiB) Viewed 2339 times

medelec35
Matrix Staff
Posts: 1432
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 505 times
Been thanked: 468 times

Re: PIC24FJ512GA606 download error!

Post 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 2332 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 2332 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.
Martin

seokgi
Posts: 164
Joined: Thu Dec 03, 2020 1:43 pm
Has thanked: 5 times
Been thanked: 6 times

Re: PIC24FJ512GA606 download error!

Post 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.

Post Reply