 |
 |
| View previous topic :: View next topic |
| Author |
Message |
spilz
Joined: 30 Jan 2012 Posts: 220
|
|
Posted: Tue Dec 06, 2016 3:37 pm |
|
|
It's 10:35 PM here, so I'm not working on it until tomorrow ^^
You have the same issue ?
I mean you are able to reproduce my issue ?
thanks for your help |
|
 |
temtronic
Joined: 01 Jul 2010 Posts: 9632 Location: Greensville,Ontario
|
|
Posted: Tue Dec 06, 2016 5:09 pm |
|
|
two comments..
1) get rid of the 'restart_wdt', etc. disable the WDT. You never need that until the product is ready to go out the door.....
2) have a look at the 'software RTC in the code library. Using that code it is dead simple to have an 'event' happen after 7 seconds. In fact I've used it in a few projects,triggering several events.
Jay |
|
 |
spilz
Joined: 30 Jan 2012 Posts: 220
|
|
Posted: Wed Dec 07, 2016 12:23 am |
|
|
Thanks for your reply, I'm agree with you.
My code does not work as simple, it's to show the issue when create a big array.
I still not understand this issue, and it's good to know if we can't use big array without unexpected issue :( |
|
 |
Ttelmah
Joined: 11 Mar 2010 Posts: 20059
|
|
Posted: Wed Dec 07, 2016 2:27 am |
|
|
What sort of LED?. For a red LED, Vf is typically only about 1.8v. Pin D4 is only rated to deliver 8mA. With 3.3v as power, the LED will be drawing nearly 15mA. Twice what the port is rated to give. These chips only have low power delivery on many of the pins.
I've just run the code up on a board I have here with the QFN 47J53, and with a 300R resistor, it is blinking the LED every 7 seconds reliably. However the fuses were those for my chip (8MHz external oscillator).
| Code: |
#FUSES ECPLL, NOWDT, WDT128, PLL2, NOXINST, NOCPUDIV, NOFCMEN, NOIESO, NOIOL1WAY, PLLEN
#use delay(clock=48MHz, USB_FULL)
|
I still have not properly seen the answer to my question about Vcore. You do understand that you don't feed 3.3v into this pin?. On the 'F' chip, this the the output from the internal regulator used to drive the chip core. It must not be above 2.75v.
My code does use the watchdog, but has it off at boot.
You do understand that your 'WDT_OFF' instruction will not work?. The watchdog can only be turned on/off in software, if it is 'off' in the fuses. If enabled in the fuses, it is always on.
This is why it is off in my fuses:
| Code: |
bit 0 WDTEN: Watchdog Timer Enable bit
1 = WDT is enabled
0 = WDT is disabled (control is placed on the SWDTEN bit)
|
You only have software control of the watchdog, if it is _off_ in the fuses. |
|
 |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Wed Dec 07, 2016 2:47 am |
|
|
I tested it with vs. 5.064 and an 18F27J53, and with the enable/disable
interrupts code. It worked with or without the array declaration.
It did a short blink about every 7 seconds. However, since this PIC
is not your exact PIC, it's not a complete test. |
|
 |
spilz
Joined: 30 Jan 2012 Posts: 220
|
|
Posted: Wed Dec 07, 2016 3:32 am |
|
|
@ Ttelmah :
- I use SMD led, datasheet says 2.1/2.3V, so OK, my resistor is a little low, I will change it to a 300R.
- thanks for your explanation about WDT, I didn't know that and it was something I wanted to work on.
- about Vcore, I just connect it to ground with a 10uF. It's what I understand from the datasheet for 'F' :
| Quote: | 2.4 Voltage Regulator Pins
(VCAP/VDDCORE)
On “F” devices, a low-ESR (< 5Ω) capacitor is required
on the VCAP/VDDCORE pin to stabilize the voltage
regulator output voltage. The VCAP/VDDCORE pin must
not be connected to VDD and must use a capacitor of 10
F connected to ground. The type can be ceramic or
tantalum. A suitable example is the Murata
GRM21BF50J106ZE01 (10 F, 6.3V) or equivalent.
Designers may use Figure 2-3 to evaluate ESR
equivalence of candidate devices.
It is recommended that the trace length not exceed
0.25 inch (6 mm). Refer to Section 31.0 “Electrical
Characteristics” for additional information.
On “LF” devices, the VCAP/VDDCORE pin must be tied to
a voltage supply at the VDDCORE level. Refer to
Section 31.0 “Electrical Characteristics” for
information on VDD and VDDCORE.
Note that the “LF” versions of these devices are
provided with the voltage regulator permanently
disabled; they must always be provided with a supply
voltage on the VDDCORE pin. |
isn't it ?
@ PCM programmer :
Thanks for your test, actually I still not understand why there is a difference with and without the array declaration. |
|
 |
spilz
Joined: 30 Jan 2012 Posts: 220
|
|
Posted: Wed Dec 07, 2016 3:47 am |
|
|
does not work for me, I have to use :
with my 4MHz external oscillator, is it normal ? |
|
 |
Ttelmah
Joined: 11 Mar 2010 Posts: 20059
|
|
Posted: Wed Dec 07, 2016 3:50 am |
|
|
| Do you have an external oscillator, or a crystal?. |
|
 |
spilz
Joined: 30 Jan 2012 Posts: 220
|
|
Posted: Wed Dec 07, 2016 4:17 am |
|
|
my mistake, I use a Crystal one
what about Vddcore/Vcap ? |
|
 |
Ttelmah
Joined: 11 Mar 2010 Posts: 20059
|
|
Posted: Wed Dec 07, 2016 4:48 am |
|
|
Your code shows you have an F device, not an LF. On the F, Vddcore is the output from the internal regulator. It needs really good smoothing, but nothing else. Key though is that it must have very good ESR performance. This is why they list the suitable types. A 'generic' capacitor on here will almost certainly give problems.
On the board I was using, there are actually five capacitors within 10mm of the chip. The 10uF Vcore capacitor, one 1uF on Vusb. two 0.1uF ones where the supply comes into the chip on opposite sides, another 10uF on the feed providing this, and inductor and 10uF capacitor on Avreg. There is a switched mode regulator that provides 5v, and this feeds a MIC29302, that gives the 3.3v supply.
The point is that it is too 'coincidental', that you started posting with problems on USB, and are now having other 'inexplicable' problems on much simpler code, using the same chip. I have to suspect there is a hardware fault. These chips are much less forgiving than the older simpler PIC's (where you could often run them off awful supplies). They need really good smooth supplies with lots of care in the layout. |
|
 |
spilz
Joined: 30 Jan 2012 Posts: 220
|
|
Posted: Wed Dec 07, 2016 5:05 am |
|
|
actually it's 2 parts of the same project, on the same board
I'm starting to use these chip, so an hardware issue is possible, but I'm surprised by the fact that just declare a varialbe without using it change so much like this ...
- I didn't connect Vdd2, I will do it and add a 100nF close to it.
- I'm using 470nF to Vusb, is it a problem ?
- I will change the 10uF Vcap, but I only have 100uF low ESR now, is it a big problem ?
I'm using 44-Pin TQFP, I don't see 'Avreg' |
|
 |
Ttelmah
Joined: 11 Mar 2010 Posts: 20059
|
|
Posted: Wed Dec 07, 2016 5:53 am |
|
|
You _must_ connect all the power pins. It's very probable that Vdd2, is actually the one feeding the RAM. Could explain a huge amount. The power connections are there because they are _needed_. Manufacturers don't waste pins. They are there to ensure a well decoupled low impedance supply to different parts of the silicon die...
Look at this thread:
<http://electronics.stackexchange.com/questions/22662/if-a-pic-mcu-provides-multiple-vdd-vss-should-you-provide-power-to-them-all>
When you add the big array, you change _where_ the other variables are stored. If part of the RAM is not properly powered, result garbage.... |
|
 |
spilz
Joined: 30 Jan 2012 Posts: 220
|
|
Posted: Wed Dec 07, 2016 7:25 am |
|
|
I connected Vdd2 to 3.3v, with a 0.1uF connected to Vss2 (Vss2 is connected to ground)
I changed the 10uF (Vcap) to one with low ESR (given by a friend)
I added 10uF on close to the power supply
I changed the resistor to a 300R
-> still have the issue :( |
|
 |
spilz
Joined: 30 Jan 2012 Posts: 220
|
|
Posted: Wed Dec 07, 2016 7:47 am |
|
|
OK,
stop searching, I'm using a USB bootloader to load my program, and without using it, it works well, so I think the issue is from the bootloader.
As the USB Bootloader works for other programs without issue, I didn't think about it.
Thanks for your help and the time you spend for me, it was not usefull, I learn a lot with you
I will open a new thread about bootloader
Spilz |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|