Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Migrating existing programs from pbp 2.x to pbp 3.0.

Status
Not open for further replies.

oliverb

Member
I have an existing program I presume written in PBP2.x. I have the demo version of PBP 3 and can't seem to get the program workng from PBP3.

The circuit is a meter clock using a 16F628A that I am trying to add a bit of code to sync it to my mater clock.

I can program a fresh chip with the original HEX code and the clock works fine. When I compile the original .bas file I get errors.

I have found the migration document for my chip and have carried out the following

Original system options
' System Clock Options
'@ DEVICE pic16F628A, HS_OSC
' Watchdog Timer
'@ DEVICE pic16F628A, WDT_ON
' Power-On Timer
'@ DEVICE pic16F628A, PWRT_ON
' Master Clear Options (Internal)
'@ DEVICE pic16F628A, MCLR_OFF
' Brown-Out Detect
'@ DEVICE pic16F628A, BOD_OFF
' Low-Voltage Programming
'@ DEVICE pic16F628A, LVP_OFF
' Data Memory Code Protect
'@ DEVICE pic16F628A, CPD_OFF
' Program Code Protection
'@ DEVICE pic16F628A, PROTECT_OFF

Replaced with this
#CONFIG
__config _HS_OSC & _WDT_ON & _PWRTE_ON & _MCLRE_OFF & _BODEN_OFF & _LVP_OFF & _CPD_OFF & _CP_OFF
#ENDCONFIG

The compile now works without errors. However when I program the chip from the HEX file the circuit no longer functions correctly.

Is there any obvious errors in what I am doing or do I have to update other parts of the code to make if work in PBP3?

Thanks.
edit I presume the demo works as the full version?
 
I have an existing program I presume written in PBP2.x. I have the demo version of PBP 3 and can't seem to get the program workng from PBP3.

The circuit is a meter clock using a 16F628A that I am trying to add a bit of code to sync it to my mater clock.

I can program a fresh chip with the original HEX code and the clock works fine. When I compile the original .bas file I get errors.

I have found the migration document for my chip and have carried out the following

Original system options
' System Clock Options
'@ DEVICE pic16F628A, HS_OSC
' Watchdog Timer
'@ DEVICE pic16F628A, WDT_ON
' Power-On Timer
'@ DEVICE pic16F628A, PWRT_ON
' Master Clear Options (Internal)
'@ DEVICE pic16F628A, MCLR_OFF
' Brown-Out Detect
'@ DEVICE pic16F628A, BOD_OFF
' Low-Voltage Programming
'@ DEVICE pic16F628A, LVP_OFF
' Data Memory Code Protect
'@ DEVICE pic16F628A, CPD_OFF
' Program Code Protection
'@ DEVICE pic16F628A, PROTECT_OFF

Replaced with this
#CONFIG
__config _HS_OSC & _WDT_ON & _PWRTE_ON & _MCLRE_OFF & _BODEN_OFF & _LVP_OFF & _CPD_OFF & _CP_OFF
#ENDCONFIG

My problem has been sorted by Tech support at ME Labs.

They said: "You were using the old PM assembler in the previous version.

The PM assembler was not “Case Sensitive”.

PBP3 only uses the MPASM assembler, which is case sensitive.

So DEFINE’s must be upper case."

I changed the following;
define intHand intRoutine
to
define INTHAND intRoutine

The circuit now works fine and my modified code now enables my meter clock (see pic below) to synchronize to my Master Clock.


Meter Clock
by Brett Oliver, on Flickr
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top