PIC Assembler 12 Bit Instruction Device Family Shop Talk

Thread Starter

PICNewbee

Joined Mar 31, 2017
355
Alrighty. Getting this error message in MPLAB X IDE and IPE.

The following memory area(s) will be programmed:
program memory: start address = 0x0, end address = 0x5
configuration memory
program memory
Address: 0 Expected Value: 25 Received Value: 0

What's the fix for this?
 

Thread Starter

PICNewbee

Joined Mar 31, 2017
355
Bebe Thank you

That would do it.

I don't know why it kept stopping short of 0x3FF during programming..

I forced it to manually use 0x00-0x3FF in memory settings IPE Memory 'Manual Settings'..

Programming...

The following memory area(s) will be programmed:
program memory: start address = 0x0, end address = 0x3ff
configuration memory
User Id Memory
Programming/Verify complete
2017-07-03 12:45:02 -0700 - Programming complete
Pass Count: 15

Ugh!
 
Last edited:

Thread Starter

PICNewbee

Joined Mar 31, 2017
355
Up next is to add code from the tutorial source code to the template.

Goal is to light up an LED.

Might try loading source code and running that now that programming is working.
 

Attachments

Thread Starter

PICNewbee

Joined Mar 31, 2017
355
Thank you.

PICKit3 User Guide says use a 4.7-10 K ohm resistor acrossed MCLR and VDD leading into PIC from PICKit3.

We have a 4.7 on there. What difference does it make using a different value resistor?

How can you test this with an ohmeter or scope for the hoped for result?
 

be80be

Joined Jul 5, 2008
2,395
Here you something to play with the led is on GPIO,4
It most times don't matter about if the mclr pin is using a 10 k or 4.7 I just use a 10'k
it works fine on mplab x
Code:
list      p=12F509            ; list directive to define processor
#include <p12F509.inc>        ; processor specific variable definitions

__CONFIG   _MCLRE_OFF & _CP_OFF & _WDT_OFF & _IntRC_OSC

; pin assignments
  
#define  led  GPIO,4  ; transmit pin on GP0



;***** VARIABLE DEFINITIONS
      UDATA
d1         res     1
d2         res     1
d3         res     1    


;**********************************************************************


; Internal RC calibration value is placed at location 0x1FF by Microchip
; as a movlw k, where the k is a literal value.

RESET   CODE    0x000           ; effective reset vector
        movwf   OSCCAL          ; update OSCCAL with factory cal value
   
    goto    init              ; jump to main program
init
    movlw b'00000000'   ; set I/O
    tris    GPIO
    bsf led
    call delay
    bcf led
    call delay
    goto init
delay
   movlw    0x03
    movwf    d1
    movlw    0x18
    movwf    d2
    movlw    0x02
    movwf    d3
Delay_0
    decfsz    d1, f
    goto    $+2
    decfsz    d2, f
    goto    $+2
    decfsz    d3, f
    goto    Delay_0

            ;6 cycles
    goto    $+1
    goto    $+1
    goto    $+1
    END
 

OBW0549

Joined Mar 2, 2015
3,565
PICKit3 User Guide says use a 4.7-10 K ohm resistor acrossed MCLR and VDD leading into PIC from PICKit3. We have a 4.7 on there. What difference does it make using a different value resistor?
It's just a pullup resistor, so within rather broad limits (say, from ≈4.7kΩ to ≈47kΩ) it makes no difference. Too small, and the PICKit3 will have a tough time driving the MCLR pin up to +12.5V or whateveritis during programming; too large, and the MCLR pin will be too susceptible to external noise, leading to spurious resets. In between, it's a total don't-care.

How can you test this with an ohmeter or scope for the hoped for result?
The only thing worth testing for is to check the voltage on the MCLR pin and verify the pin is being pulled up to Vdd during operation-- that is, verify that the resistor is actually connected.
 

MaxHeadRoom

Joined Jul 18, 2013
30,772
Out of interest, the Picmicro development boards with ICD connector use a 10k pull up with a .1μf de-coupling cap.
What I traditionally use with no problems.
Max.
 

be80be

Joined Jul 5, 2008
2,395
Hes worrying for nothing mclr just tie it with a 10 k its just a switch to turn on the chip nothing more on or off
and used for programming if it was hard to ground the the programmer not be able to put the chip in programming mode.

But after you get the hang of this you'll be using the mclr as a regular pin LOL
MCLRE: = 0 //digital input, MCLR internally tied to VDD

I tell you the 12f508 and the 509 are pain in the butt chips i dug one out to play alone with you. It took 5 time to get the chip to program at first i think thats bug in the programming software I had to set the pickit voltage using the calibrate and turn off the fast programming.
Plus regenerate the osccal
You can see it working here
 
Last edited:

Thread Starter

PICNewbee

Joined Mar 31, 2017
355
Bebe

That was big of you! Thanks!

1) I'm using a PICKit3 clone.

2) Powering from PICKit3

3) Mine is on a breadboard like that.

Will go at it again in a couple hours from now.
 

Thread Starter

PICNewbee

Joined Mar 31, 2017
355
Bebe

'set the pickit voltage using the calibrate'

Don't know what you mean.

'turn off the fast programming.'

The slider for speed wouldn't mover in IPE. I thought of slowing it down too.

I can put this on the bread board of a basic stamp board and bootleg the VDD and VSS.

It's 5v and filtered already.
 

Thread Starter

PICNewbee

Joined Mar 31, 2017
355
Bebe

In fact! I have a nice big Propellor Professional board with big bread board area.

It has nice 5 volt connectors to tap off power.

https://www.parallax.com/product/32111 It even has LED bank with resistors already hardwired in.

It takes a 12v wall power supply coming in and drops it down. Should have plenty of good power.

How does that sound?
 

be80be

Joined Jul 5, 2008
2,395
I just use a old phone charger most all of them these days put out a nice 5 volts.
I got one at the dollar store for near nothing it's good for 1 amp and works great
 
Top