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.

16F84 to 16F628A help needed

Status
Not open for further replies.
The whole circuit is imho not bad.
I will not use it as a darkroom timer but as a precision timer for inflating balloons for my wife. :)
She is into this business.
So the issue for the BCD switches in low light conditions does not apply to my actual needs.

@mvs sarma,
would it be to much to ask you for a version of the code for use with the internal osc? :eek:
PLEEEEAAAASE ???!!!??!! :)
As now Ericgibbs takes over, i shall relax, being a learner still. I will try for experience, but you are likely to get a cute software from the hands of Eric. The internal oscillator may be 8MHz and all the delays are to be re-tuned.
 
Last edited:
This is the final schematic i intend to use.
 

Attachments

  • timerfinal.PNG
    timerfinal.PNG
    61.3 KB · Views: 238
Sarma you're right.
That should be a zero.
Maybe i can later understand the whole code and remove the unneeded parts.
 
Last edited:
hi,
This program is now for the 16F628A, internal 4mHz clock.

It runs OK on the Oshonsoft simulator.

Its been disassembled from the hex file you posted, lets know how it goes.:)
 

Attachments

  • timer3m.asm
    7.2 KB · Views: 168
Hello Eric,
and thanks a lot for the code.
I don't know if it is OK because i couldnt programm the 16F628A.

So far i have
-installed the MPLAB V8.20,
-selected the 16F628A,
-installed the FTDI drivers for my Olimex PIC-MCP-USB-MPLAB Compatible Programmer
-changed the COm Port from 1 to 4 so that the MPLAB sees the Programmer right
-and programmed the chip but got an error.

Please see for yourself.

----------------------------------------------------------------------
Debug build of project `C:\Documents and Settings\SK\Desktop\timer3m.disposable_mcp' started.
Preprocessor symbol `__DEBUG' is defined.
Mon Mar 09 14:15:18 2009
----------------------------------------------------------------------
Clean: Deleting intermediary and output files.
Clean: Done.
Executing: "C:\Program Files\Microchip\MPASM Suite\MPASMWIN.exe" /q /p16F628A "timer3m.asm" /l"timer3m.lst" /e"timer3m.err" /d__DEBUG=1
Executing: "C:\Program Files\Microchip\MPASM Suite\mplink.exe" /p16F628A "timer3m.o" /u_DEBUG /z__MPLAB_BUILD=1 /z__MPLAB_DEBUG=1 /o"timer3m.cof" /M"timer3m.map" /W /x
MPLINK 4.30.01, Linker
Copyright (c) 2009 Microchip Technology Inc.
Errors : 0

Loaded C:\Documents and Settings\SK\Desktop\timer3m.cof.
----------------------------------------------------------------------
Debug build of project `C:\Documents and Settings\SK\Desktop\timer3m.disposable_mcp' succeeded.
Preprocessor symbol `__DEBUG' is defined.
Mon Mar 09 14:15:19 2009
----------------------------------------------------------------------
BUILD SUCCEEDED



---------------------------------------------------------------
A newer version of the PICSTART Plus firmware operating
system is available, and may be required for programming
some devices. The newer version is located in your
MPLAB IDE\PicstartPlus directory. Refer to the topic,
'Upgrading the PICSTART Plus Operating System' in the
PICSTART Plus Help file for instructions.
PICSTART Plus Firmware Version 04.50.06

PICSTART Program\Verify Report
09-Mar-2009, 14:18:28

Device Type: PIC16F628A
Address Range 0-e1


Program Memory Errors

Address Good Bad

0000: 30FF 0000
0001: 008E 0000
0002: 00AF 0000
0003: 0090 0000
0004: 30FF 0000
0005: 00A2 0000
0006: 3007 0000
0007: 009F 0000
0008: 20DA 0000
0009: 10A0 0000
000A: 20D4 0000
000B: 10A0 0000
000C: 20CE 0000
000D: 10A0 0000
000E: 20C8 0000
000F: 10A0 0000
0010: 20C2 0000
0011: 14A0 0000
0012: 20BC 0000
0013: 14A0 0000
0014: 20B6 0000
0015: 14A0 0000
0016: 20B0 0000
0017: 14A0 0000
0018: 20AA 0000
0019: 01A2 0000
001A: 01A3 0000
001B: 01A4 0000
001C: 10A0 0000
001D: 1120 0000
001E: 11A0 0000
001F: 20A3 0000
Any additional errors are not displayed.


Configuration Memory Errors

Field : Oscillator
Expected: INTOSC: I/O on RA6/OSC2/CLKOUT, I/O on RA7/OSC1/CLKIN
Received: LP

Field : Code Protect
Expected: Off
Received: On

Field : Brown Out Detect
Expected: Enabled
Received: Disabled

Field : Master Clear Enable
Expected: Enabled
Received: Disabled

Field : Data EE Read Protect
Expected: Disabled
Received: Enabled


What have i done wrong ?????:(

Regards
Stamatis
 
hi,

When you started the MPLAB project did you use the Wizard.??

Those config errors can be caused by the CONFIG statement in the program header, not agreeing with settings in the MPLAB configuration window.

Have you selected the MPLAB debugger and prommer options.?

I'll retry the program in MPLAB not OS.
 
Last edited:
hi,
Just started MPLAB using the Wizard and then the 'Build All' option.

It assembles OK.

Copy of Output window.
Code:
Executing: "C:\Program Files\Microchip\MPASM Suite\MPAsmWin.exe" /q /p16F628A "timer3m.asm" /l"timer3m.lst" /e"timer3m.err"
Loaded C:\Documents and Settings\Administrator\Desktop\timer3m.cod.
BUILD SUCCEEDED: Mon Mar 09 12:55:53 2009

Use the Release option not Debug for a PIC.
 
Hello Eric,
i did not use the Wizard.
After you mentioned it i did.
It assembles OK here too.
But i haven't figured out how to set the config bits right because i get this:

"Configuration Memory has not been updated.
Press "Yes" to accept the current configuration
or "No" to abort the operation."

Try to figure out where i have to change what to get it done.
I need some time....

Thanks for your patience.:)
I know that i'm a totally beginner.:eek:

Regards
Stamatis

---------------------------------------

Btw is this a problem???


PICPICSTART Plus Firmware Version 04.50.06


A newer version of the PICSTART Plus firmware operating
system is available, and may be required for programming
some devices. The newer version is located in your
MPLAB IDE\PicstartPlus directory. Refer to the topic,
'Upgrading the PICSTART Plus Operating System'
in the
PICSTART Plus Help file for instructions.
 
hi,
In the Configuration Window is a Check Box 'Config bits set in code' Click so its checked [enabled].

Ignore the Newer Version msg at this time.
 
Hello Eric,

i will go crazy....

I started fresh,
used the Wizard,
selected the 16F628A,
named the project,
added the timer3m.asm file that you've send me yesterday,
used the "Build all" tool,
choosed relocatable code,
the build suceeded,
checked the config bits box as you said,
choosed the Olimex programmer which i have already updated to the latest version,
enabled the programmer in MPLAB,
and when i'm trying to programm the chip i get this:

"Configuration Memory has not been updated.
Press "Yes" to accept the current configuration
or "No" to abort the operation."

When i choose "Yes"

i get this:


PICSTART Program\Verify Report
09-Mar-2009, 16:20:20

Device Type: PIC16F628A
Address Range 0-e3


Program Memory Errors

Address Good Bad

0000: 30FF 0000
0001: 008E 0000
0002: 00AF 0000
0003: 0090 0000
0004: 30FF 0000
0005: 00A2 0000
0006: 3007 0000
0007: 009F 0000
0008: 20DA 0000
0009: 10A0 0000
000A: 20D4 0000
000B: 10A0 0000
000C: 20CE 0000
000D: 10A0 0000
000E: 20C8 0000
000F: 10A0 0000
0010: 20C2 0000
0011: 14A0 0000
0012: 20BC 0000
0013: 14A0 0000
0014: 20B6 0000
0015: 14A0 0000
0016: 20B0 0000
0017: 14A0 0000
0018: 20AA 0000
0019: 01A2 0000
001A: 01A3 0000
001B: 01A4 0000
001C: 10A0 0000
001D: 1120 0000
001E: 11A0 0000
001F: 20A3 0000
Any additional errors are not displayed.


Configuration Memory Errors

Field : Oscillator
Expected: INTOSC: I/O on RA6/OSC2/CLKOUT, I/O on RA7/OSC1/CLKIN
Received: LP

Field : Code Protect
Expected: Off
Received: On

Field : Brown Out Detect
Expected: Enabled
Received: Disabled

Field : Master Clear Enable
Expected: Enabled
Received: Disabled

Field : Data EE Read Protect
Expected: Disabled
Received: Enabled


Final warning from MPLAB : Failed

Any suggestions ???
 
Instead why not try to load the hex file without MPLAB and see whether you can program your F628A?

we can later do the research of this MPlab linkup.
 
Hello Sarma,
i tried to import the .HEX file and programm it with MPLAB.
No sucess.

I also don't know if the Olimex is OK. It's used out of the box.

Maybe i should use some other programm than the MPLAB to programm the PIC.
Any suggestions for that?

Thanx

Stamatis
 
hi,
Just programmed a 16F628A PIC, no problems, this is the Output window.

Is your prommer compatible with MPLAB.???

Code:
PICSTART Program\Verify Report
09-Mar-2009, 14:46:26

Device Type: PIC16F628A
Address Range 0-e1
Programming/Verification completed successfully


EDIT: Use configuration window to set the configuration bits as per the program CONFIG settings.
 
Last edited:
Hi,
the Programmer should be work with MPLAB as it is advertised as a MPLAB compatible PIC programmer.

This is the beast:
Development and Prototype boards and tools for PIC AVR and MSP430

It has USB, latest FTDI drivers, set on Virtual COM Port 4, it is recognised by MPLAB but the final result doesn't match my expectations.:(:(:(:(:(

I don't know if it's me or the hardware....

Im not completly sure, but I think this 'Virtual Com Port 4' has been raised by other members.??????
 
I have the Olimex PIC-MCP-USB Programmer.

Made in 2007, newest software (V1.30)

@Eric , what exactly you mean by saying:
"...but I think this 'Virtual Com Port 4' has been raised by other members.??????" ????

Regards
Stamatis
 

Attachments

  • Olimex.jpg
    Olimex.jpg
    46.5 KB · Views: 179
I have the Olimex PIC-MCP-USB Programmer.

Made in 2007, newest software (V1.30)

@Eric , what exactly you mean by saying:
"...but I think this 'Virtual Com Port 4' has been raised by other members.??????" ????

Regards
Stamatis

As a problem with the settings within Windows.????
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top