Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Probleme digital input Pinguino/MPLAB X (FR/EN)
26-04-2013, 07:16 PM,
#1
Question  Probleme digital input Pinguino/MPLAB X (FR/EN)
FRANCAIS Wink
Bonjour, j'ai une Pinguino micro
Lorsque je configure en OUTPUT RC13 et que je lui donne son état, cela marche très bien à partir de Pinguino X.4 en le faisant :
Code:
void setup() {
    TRISCCLR = 0x2000;
    }

void loop() {
    delayMicroseconds(100000);
    LATCINV=0x2000;
    }

et quand je fais la même chose sous MPLAB X, ça ne marche pas (à l'oscillo, le signal est ni à 0, ni à 3.3 mais aux alentours de 600mV).
Le plus étonnant, c'est que j'ai ce problème sur certain port, mais pas sur d'autress port comme RE0.

En regardant en debug les registres de périphérique, LATC change bien, mais pas PORTC (même si je met PORTCINV à la place de LATCINV).
Merci d'avance pour votre aide, j'ai cherché et retourner le problème dans tout les sens, mais je ne trouve pas de solution.

ENGLISH Tongue
Hello,
I have a Pinguino Micro,
But, when I config in OUTPUT RC13 and I guive it state, the result is very well with Pinguino X.4
Code:
void setup() {
    TRISCCLR = 0x2000;
    }

void loop() {
    delayMicroseconds(100000);
    LATCINV=0x2000;
    }
but when I do it with MPLABX, it doesn't work (with scope, I don't have neither 0V nor 3.3V but about 600mV).
The most amasing, I have this bug only on any port, but on all the port (RE0 work well)

When I watch the register of peripheral with MPLAB X, LATC switch, but PORTC never switch (it is the same problem when I write PORTCINV instead of LATCINV).

Thank you very much for your help, I search but I don't see !!Sad
And sorry for my poor english Confused
Reply
26-04-2013, 08:15 PM,
#2
RE: Probleme digital input Pinguino/MPLAB X (FR/EN)
Hi,
If it works with Pinguino then I'd take a look at the config words under MPLABX. Especially the FSOSCEN bit because RC13 is multiplexed with Second Osc. Input.
It is easier to complain than it is to do, but it is better to do than it is to complain.
Reply
26-04-2013, 08:29 PM,
#3
RE: Probleme digital input Pinguino/MPLAB X (FR/EN)
Thanks, it will be this, because I think use the second osc. Input.
My pragma config is
Code:
#pragma config FPLLMUL  = MUL_20  
#pragma config FPLLIDIV = DIV_2
#pragma config UPLLIDIV = DIV_2
#pragma config UPLLEN = ON
#pragma config FPLLODIV = DIV_1
#pragma config FPBDIV   = DIV_1
#pragma config FWDTEN   = OFF
#pragma config WDTPS    = PS32768
#pragma config FCKSM    = CSECME
#pragma config OSCIOFNC = OFF
#pragma config POSCMOD  = HS
#pragma config IESO     = ON
#pragma config FSOSCEN  = ON
#pragma config FPLLMUL  = MUL_20  
#pragma config CP       = OFF
#pragma config BWP      = OFF
#pragma config PWP      = OFF
#pragma config ICESEL   = ICS_PGx2
#pragma config DEBUG    = OFF
How can I do for a working solution (the problem is also with RC14)

And how can I know the configuration using with Pinguino. To use the basic config pinguino in MPLAB ?

Thanks for your help


(26-04-2013, 08:15 PM)regis Wrote: Hi,
If it works with Pinguino then I'd take a look at the config words under MPLABX. Especially the FSOSCEN bit because RC13 is multiplexed with Second Osc. Input.
Reply
26-04-2013, 09:06 PM,
#4
RE: Probleme digital input Pinguino/MPLAB X (FR/EN)
If you want to use the 2nd Osc. then do not use RC13 and RC14.
If you want to use RC13 and RC14 then turn FSOSCEN to OFF.
It's up to you.
It is easier to complain than it is to do, but it is better to do than it is to complain.
Reply
26-04-2013, 10:29 PM,
#5
Thumbs Up  RE: Probleme digital input Pinguino/MPLAB X (FR/EN)
Thanks, very thanks. It's ok Big Grin
Do you know where I can learn more about configuration of µC.
I read datasheet, but on pragma I find anything.

Thanks
Reply
27-04-2013, 12:59 AM,
#6
RE: Probleme digital input Pinguino/MPLAB X (FR/EN)
I don't use MPLAB X but have you looked at http://microchip.wikidot.com/mplab:how-t...ation-bits ?

Microchip's website also has a document named "Using the right Format, Syntax and Definitions for PICmicro Configuration Bits" that explains where to find the configuration settings for your particular device. See: http://ww1.microchip.com/downloads/en/De...itions.pdf
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)