Failure to multiplex rb3

Discuss PIC and electronic related things

Moderators: David Barker, Jerry Messina

Post Reply
liak
Registered User
Registered User
Posts: 195
Joined: Fri Oct 05, 2007 12:26 am

Failure to multiplex rb3

Post by liak » Fri Aug 08, 2008 11:12 am

Dear all,
I have been using 18F1320 all this while. The CCP1 module for this PIC is different from the rest. It is assigned to rb3, while the others commonly to rc2. I am now using 18F2525 for my project. According to the datasheet, it is possible to multiplex the CCP2 which is assigned to rc1 to rb3 by clearing the bits in CCPM2X. I have set the following config in my code:

Code: Select all

config CCPM2X = POrtBE
In short, I am using the PWM in CCP2 multiplexed to rb3. The outcome however to me is a surprise. The PWM signals seem to work only intermittently. Anyone has any experience with this? Any explanation or simply a silicon failure by Microchip's part?

regards
Liak
:?

Doj
Posts: 362
Joined: Wed Apr 11, 2007 10:18 pm
Location: East Sussex

Post by Doj » Sat Aug 09, 2008 10:20 am

Hello liak,

I use the big brother of this chip 18F4620 in a major project that uses config CCPM2X = PORTBE and it is 100% reliable.

Have a look here:-
http://www.microchip.com/stellent/idcpl ... odeId=2045
This is the errata document page which does say the CCp module can have an issue if you are using a certain mode, but I do not think it applies to you and my use is ok.

Here is my config that works for you to try:-

Code: Select all

Config
        OSC=HSPLL,                                  'enable PLL for 16MHz with 4 MHz crystal
        FCMEN=OFF,
        IESO=OFF,
        PWRT=ON,
        BOREN=OFF,
        BORV=3,
        WDT=OFF,
        WDTPS=128,
        MCLRE=ON,                                   'allow MCLRE to be used as hard reset
        LPT1OSC=OFF,                                'TIMER1 external oscilator
        PBADEN=OFF,                                 'PORTB .4 to.0 reset type, off=digital, on=analogue
        CCP2MX=PORTBE,                              'CCP2 output, PORTBE=RB3, PORTC=RC1 
        STVREN=OFF,                                 'stack overflow reset
        LVP=OFF,                                    'low voltage ICSP
        XINST=OFF,                                  'extended instruction set
        DEBUG=OFF,
        CP0=OFF,                                    'memory protection
        CP1=OFF,
        CP2=OFF,
        CP3=OFF,
        CPB=OFF,
        CPD=OFF,
        WRT0=OFF,
        WRT1=OFF,
        WRT2=OFF,
        WRT3=OFF,
        WRTB=OFF,
        WRTC=OFF,
        WRTD=OFF,
        EBTR0=OFF,
        EBTR1=OFF,
        EBTR2=OFF,
        EBTR3=OFF,
        EBTRB=OFF

liak
Registered User
Registered User
Posts: 195
Joined: Fri Oct 05, 2007 12:26 am

Post by liak » Sun Aug 10, 2008 3:03 pm

Dear Doj,
Thanks for your response. It's very valuable. :lol:
I have tried looking into the link you have provided. But some error had occurred - Missing content.
Anyway, you have mentioned in a particular mode the CCP2 may fail to be multiplex to the rb3. Can you elaborate a bit on it, as I seem to fail to get to the errata you have specified. I am just using the CCP2 in PWM mode, I doubt it should fail, as you have said.
Thanks also for the codes. I will play with it and see if it works.

regards,
Liak :wink:

Doj
Posts: 362
Joined: Wed Apr 11, 2007 10:18 pm
Location: East Sussex

Post by Doj » Sun Aug 10, 2008 3:25 pm

This is the errata:-
"3. Module: ENHANCED CAPTURE/
COMPARE/PWM (ECCP)
With the ECCP configured for Half-Bridge PWM
mode (CCP1M3:0 = 1110), the output may be
corrupted for particular duty cycle selections.
Affected duty cycle values are 0 though 3, and
every subsequent increment of 4 (i.e., 7, 11, 15,
19, etc.).
Work around
None.
Date Codes that pertain to this issue:
All engineering and production devices."

It should not matter to you.
The multiplex works fine for me,are you sure the programmer is actually writing the config fuses and not ignoring them?, also is the WDT off.

liak
Registered User
Registered User
Posts: 195
Joined: Fri Oct 05, 2007 12:26 am

Config fuse not programmed???!

Post by liak » Mon Aug 11, 2008 3:54 am

Dear Doj,
Thanks for the addition. You are right, my project doesn't use any of those settings. Still I tried your codes, the same intermittent working PWM channel on RB3.
You have raised a problem which I have not thought about. But this could answer my previous observation that my config commands weren't implemented.
Is it possible for the programmer to omit the config? I thought everything that's compiled will get programmed exactly like the rest of the codes. May I ask: How to check for it?
Previously I did try on another config fuse: code protection enabling,

Code: Select all

config CP = on
However, I was still able to read the PIC data, which should not happen once the CP was enabled. So I was confused by it, but it had never crossed my mind that the config may not be programmed. I didn't check on the problem after I was overwhelmed by other urgent matters at hand.
Can explain why the config may be missed out? How to check it? And how to make sure the config is programmed?

Thanks a bunch.

Regards
Liak

Doj
Posts: 362
Joined: Wed Apr 11, 2007 10:18 pm
Location: East Sussex

Post by Doj » Mon Aug 11, 2008 4:46 pm

Liak your programmer may have two options, one is to read the configuration from software(this is the options you set with CONFIG=...)
which is how all my programmers work.
Second is you use the programmer to set the fuse options, this will ignore the software fuses you create and use its own.
It sounds like your programmer is not reading the software fuses or you have the option turned off.

What is your programmer, I am sure we will be able to get it tested.

liak
Registered User
Registered User
Posts: 195
Joined: Fri Oct 05, 2007 12:26 am

Post by liak » Tue Aug 12, 2008 5:31 am

Dear Doj,
I am using the microcode loader which comes with the original SF. I don't see any options in the loader window.
Am I missing something? Or can you suggest what other programmer to be used together with SF?
The current loader works just fine all the while until I suspected that the config fuse may be not implemented. Any help?

Thanks.

:oops:
Regards,
Liak

Doj
Posts: 362
Joined: Wed Apr 11, 2007 10:18 pm
Location: East Sussex

Post by Doj » Tue Aug 12, 2008 9:14 pm

Hello Liak,
I do not use the microcode loader, I think that is a bootloader?
If it is a bootloader I think this is where the issue lies.

I would never use a bootloader in development work as they are not very flexible, as far as I know you need a new bootloader with all the correct fuse settings for each type of chip, I have never used one at all and probably never will(I stand to be corrected!).

If the above is true then I can not help any more sorry.

A very cheap and flexible programmer which I use in my business(we have 5 of them) is the Microchip PicKit 2, it is very cheap at £17.50 and works with as many chips as Microchip make(up to 18 series to my knowledge).

User avatar
octal
Registered User
Registered User
Posts: 586
Joined: Thu Jan 11, 2007 12:49 pm
Location: Paris IDF
Contact:

Post by octal » Tue Aug 12, 2008 9:24 pm

Doj wrote:Hello Liak,
I would never use a bootloader in development work as they are not very flexible, as far as I know you need a new bootloader with all the correct fuse settings for each type of chip, I have never used one at all and probably never will(I stand to be corrected!).
Booloaders are really very flexible during dev time. As for final product, all depends on what you want to do (depending on security ... easiness of update, ...). For information www.mecanique.co.uk sells a commercial bootloader dll that let you costumize your application side program if needed. More details here
http://www.mecanique.co.uk/products/pic ... oader.html

Doj wrote:...
and works with as many chips as Microchip make(up to 18 series to my knowledge).
it can program absolutely almost all programmable devices produced by Microchip (From 10Fxxx to PIC32 .. and all serial memories)...
here is the impressive list:

http://www.microchip.com/stellent/idcpl ... e=en027813

Doj
Posts: 362
Joined: Wed Apr 11, 2007 10:18 pm
Location: East Sussex

Post by Doj » Wed Aug 13, 2008 1:10 pm

Thanks octal for the link, that confirms my definition of not being too flexible(for me), apart from on recent development kit I am using only J and K parts which do not appear on that page.

I expect a customer made update would be a sensible use for such an idea if the files were available for that particular chip.

No doubt many people will find it perfect for their own solution.

liak
Registered User
Registered User
Posts: 195
Joined: Fri Oct 05, 2007 12:26 am

Post by liak » Wed Aug 13, 2008 3:02 pm

Dear Doj and Octal,
Thanks Doj. It's a bootloader that I am using. Sorry for confusing you earlier. So I guess now I have to ask anyone else who has been using the microcode loader. Octal, do you think this missing fuse config thing is possibly from the bootloader? Anyway to update this? I am not sure whether the one that comes with SF is licensed or up to date.

Regards,
Liak

Post Reply