Hello?
I have many problems.
When will the problem of no digital output from MCU be resolved?
thank you.
PIC24FJ512GA606 download error!
-
- Posts: 206
- http://meble-kuchenne.info.pl
- Joined: Thu Dec 03, 2020 1:43 pm
- Has thanked: 5 times
- Been thanked: 7 times
Re: PIC24FJ512GA606 download error!
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.
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.
-
- Matrix Staff
- Posts: 1926
- Joined: Mon Dec 07, 2020 10:06 am
- Has thanked: 503 times
- Been thanked: 686 times
Re: PIC24FJ512GA606 download error!
Hello,
To set a pin as an output you do something like this.
Or you can use the FC output icon.
To set a pin as an input you do something like this.
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?
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
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
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;
Regards Ben Rowland - MatrixTSL
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
Re: PIC24FJ512GA606 download error!
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.
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 (119.04 KiB) Viewed 5683 times
-
- Matrix Staff
- Posts: 1926
- Joined: Mon Dec 07, 2020 10:06 am
- Has thanked: 503 times
- Been thanked: 686 times
Re: PIC24FJ512GA606 download error!
Pin B13 is a JTAG pin, do you have JTAG debugging enabled in your configuration settings?
Regards Ben Rowland - MatrixTSL
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
Re: PIC24FJ512GA606 download error!
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.
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 (24.94 KiB) Viewed 5575 times
-
- Matrix Staff
- Posts: 1921
- Joined: Wed Dec 02, 2020 11:07 pm
- Has thanked: 623 times
- Been thanked: 645 times
Re: PIC24FJ512GA606 download error!
Hi.
If you change to the light theme it will show you: 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. 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.
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: 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. 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
Re: PIC24FJ512GA606 download error!
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.
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.