PDA

View Full Version : Beginner problems with 18F66J50



prstein
- 16th August 2010, 19:15
I'm trying to move beyond my comfort zone chips, the 16F877 and the 18F452, and expand my horizons. So far it is kicking my tail and making me feel like a total n00b. 8^(

All I'm trying to do is make a pin (any pin!) alternate between high and low. Not even trying to blink an LED, I'm using an oscilloscope. (Blinky will be the next step...)

I'm using an MELabs Pic Proto80 board with a 2.5V regulator. I'm programming through the PP80's ISCP using an MEL U2 programmer. It appears to be taking the code but nothing whatsoever happens on any of the pins.

My code is below, and I've attached the schematic and a screenshot of the programmer configuration. I'm at a total loss and I would truly appreciate any helpful guidance in this matter.


define OSC 20

INCLUDE "ALLDIGITAL.pbp"

TRISA = 0
TRISB = 0
TRISC = 0
TRISD = 0
TRISE = 0
TRISF = 0

MainLoop:
PORTA = 1
PORTB = 1
PORTC = 1
PORTD = 1
PORTE = 1
PORTF = 1
pause 100

PORTA = 0
PORTB = 0
PORTC = 0
PORTD = 0
PORTE = 0
PORTF = 0
pause 100
goto mainloop

Thanks for reading,
Paul

Bruce
- 16th August 2010, 19:48
Have you tried it with extended instruction set disabled?

prstein
- 16th August 2010, 20:05
Have you tried it with extended instruction set disabled?

I just tried that, still no joy. Thank you, though.

Best Regards,
Paul

rsocor01
- 16th August 2010, 20:29
Have you tried a different "Oscillator Selection"?

Robert

prstein
- 16th August 2010, 21:06
Have you tried a different "Oscillator Selection"?

Robert

I've now gone and tried all of them again, this time with extended instruction set disabled. No luck. Thanks for trying.

Best Regards,
Paul

rsocor01
- 16th August 2010, 21:37
I've now gone and tried all of them again, this time with extended instruction set disabled. No luck. Thanks for trying.

Best Regards,
Paul

I also see that you don't have a diode in MCRL protecting Vdd from Vpp. From the PIC datasheet, the maximum absolute value that Vdd can take is around 4.5 V. If the programming voltage, Vpp, is greater than 4.5V you might have damaged the PIC by no using a diode.

I don't see anything else that might be causing problems.

Robert

mackrackit
- 16th August 2010, 22:02
The drawing also only has half of the OSC connected. But I am sure that is only on the drawing...

Why not try just for fun, setting the configs not with the programmers software but in the *.inc or code space?

The settings in the *.inc straight from the install for this chip should have you running with a 20 OSC.

Then
DEFINE OSC 48
Me thinks.

prstein
- 17th August 2010, 00:51
I also see that you don't have a diode in MCRL protecting Vdd from Vpp. From the PIC datasheet, the maximum absolute value that Vdd can take is around 4.5 V. If the programming voltage, Vpp, is greater than 4.5V you might have damaged the PIC by no using a diode.

I don't see anything else that might be causing problems.

Robert

Thanks again, Robert. The ISCP is not providing Vdd for the board. Vdd comes from a 2.5V regulator. I verified with a 'scope that Vdd is not changing during programming. I can see the programming data coming in at 5V, but PORTB is 5.5V tolerant.

Best Regards,
Paul

prstein
- 17th August 2010, 00:57
The drawing also only has half of the OSC connected. But I am sure that is only on the drawing...

Why not try just for fun, setting the configs not with the programmers software but in the *.inc or code space?

The settings in the *.inc straight from the install for this chip should have you running with a 20 OSC.

Then
DEFINE OSC 48
Me thinks.

Thanks for catching the error in the schematic, but as you surmised the resonator is indeed connected.

I don't alter the inc file because I have no luck figuring out what they should be, at least in this case. I'm happy to try most anything to get this to work...

I tried adding the define (and also several sets of configuration settings), with the same negative result.

Best Regards,
Paul

prstein
- 17th August 2010, 23:07
Thanks to everyone who replied. You were all headed in the right direction. Turned out to be the beta MELabs U2 programming software. For some reason it wasn't picking up the settings in the .inc file. I went back to the earlier version of the programmer software (and had to copy 18F66J50.inc to that folder--not supporting that chip was why I tried the beta download) and everything worked fine.

Now knowing the proper programmer settings I tried the beta again, still wouldn't work. I guess I should report a bug to MEL.

Best Regards,
Paul

mackrackit
- 17th August 2010, 23:34
COOL!

Have you tried setting the configs in code space? Might be a work-around.
http://www.picbasic.co.uk/forum/content.php?r=157-Presetting-Configuration-Fuses-(PIC-Defines)-into-your-Program

Bruce
- 18th August 2010, 03:36
Robert mentioned an important point about the protection diode - I would also take into consideration. It may work for a while, then just fail, if you don't add that diode. It's well worth the expense. Just FYI.

prstein
- 18th August 2010, 15:12
COOL!

Have you tried setting the configs in code space? Might be a work-around.
http://www.picbasic.co.uk/forum/content.php?r=157-Presetting-Configuration-Fuses-(PIC-Defines)-into-your-Program

Thanks Dave. Now that I can start running with this project I will certainly do that.

Best Regards,
Paul

prstein
- 18th August 2010, 15:13
Robert mentioned an important point about the protection diode - I would also take into consideration. It may work for a while, then just fail, if you don't add that diode. It's well worth the expense. Just FYI.

I know better than to ignore advice from The Bruce! Consider it added.

Best Regards,
Paul