PIC calculator

Status
Not open for further replies.
__config 0x3D18 means 0011 1101 0001 1000

15 = 0 = not used
14 = 0 = not used
13 = 1 = Flash Code protect off
12 = 1 = unused so ignore

11 = 1 = unused so ignore
10 = 1 = unused so ignore
9 = 0 = unused so ignore
8 = 1 = Data Code protect=off

7 = 0 = Use MCLR for programming
6 = 0 = Brown out reset disabled
5 = 0 = MCLR is I/O
4 = 1 = (100) internal Osc.

3 = 1 = powerup timer disabled
2 = 0 = watchdog disabled
1 = 0 = FOSC1 = internal oscillator (100)
0 = 0 = FOSC0 = internal oscillator (100)

so bit 4,1 and 0 being 1,0,0 respectively, means
INTRC oscillator: I/O function on RA6/OSC2/CLKOUT pin, I/O function on RA7/OSC/CLKIN

I also tried
__config Ox2109
which means 0010 0001 0000 1001
so bit 4,1 and 0 being 0,0,1 respectively, means
XT oscillator: Crystal/resonator on RA6/OSC2/CLKOUT and RA7/OSC1/CLKIN

Still there was no display on the Lcd, so which of this configurations must I use for bit 4,1 and 0:

FOSC2:FOSC0: Oscillator Selection bits(4)
111 = ER oscillator: CLKOUT function on RA6/OSC2/CLKOUT pin, Resistor on RA7/OSC1/CLKIN
110 = ER oscillator: I/O function on RA6/OSC2/CLKOUT pin, Resistor on RA7/OSC1/CLKIN
100 = INTRC oscillator: I/O function on RA6/OSC2/CLKOUT pin, I/O function on RA7/OSC1/CLKIN
011 = EC: I/O function on RA6/OSC2/CLKOUT pin, CLKIN on RA7/OSC1/CLKIN
010 = HS oscillator: High speed crystal/resonator on RA6/OSC2/CLKOUT and RA7/OSC1/CLKIN
001 = XT oscillator: Crystal/resonator on RA6/OSC2/CLKOUT and RA7/OSC1/CLKIN
000 = LP oscillator: Low power crystal on RA6/OSC2/CLKOUT and RA7/OSC1/CLKIN
 
Last edited:
Why not just do this, also you just suggested Clock Out twice.
Code:
	__CONFIG	_CONFIG1,   _PWRTE_ON  & _WDT_OFF & _INTRC_OSC_NOCLKOUT & _BOR_OFF  & _LVP_OFF & _CP_OFF & _MCLRE_OFF
 
when I use

__CONFIG _CONFIG1, _PWRTE_ON & _WDT_OFF & _INTRC_OSC_NOCLKOUT & _BOR_OFF & _LVP_OFF & _CP

I get the following erros on MPLAB

Release build of project `D:\SEKOLO\forum\mplab\lcd_copy.disposable_mcp' started.
Language tool versions: MPASMWIN.exe v5.30.01, mplink.exe v4.30.01
Thu Dec 09 20:41:43 2010
----------------------------------------------------------------------
Clean: Deleting intermediary and output files.
Clean: Done.
Executing: "C:\Program Files\Microchip\MPASM Suite\MPASMWIN.exe" /q /p16F628A "lcd_copy.asm" /l"lcd_copy.lst" /e"lcd_copy.err"
Error[113] D:\SEKOLO\FORUM\MPLAB\LCD_COPY.ASM 8 : Symbol not previously defined (_CONFIG1)
Error[108] D:\SEKOLO\FORUM\MPLAB\LCD_COPY.ASM 8 : Illegal character (,)
Halting build on first failure as requested.
----------------------------------------------------------------------
Release build of project `D:\SEKOLO\forum\mplab\lcd_copy.disposable_mcp' failed.
Language tool versions: MPASMWIN.exe v5.30.01, mplink.exe v4.30.01
Thu Dec 09 20:41:44 2010
----------------------------------------------------------------------
BUILD FAILED
 
Thanks man for the new version, Maybe this time there is something wrong with how I have setup, MPLAB. I still get the same error

Release build of project `D:\SEKOLO\forum\mplab\lcd_copy.disposable_mcp' started.
Language tool versions: MPASMWIN.exe v5.37, mplink.exe v4.37, mplib.exe v4.37
Sat Dec 11 13:30:27 2010
----------------------------------------------------------------------
Clean: Deleting intermediary and output files.
Clean: Done.
Executing: "C:\Program Files\Microchip\MPASM Suite\MPASMWIN.exe" /q /p16F628A "lcd_copy.asm" /l"lcd_copy.lst" /e"lcd_copy.err"
Error[113] D:\SEKOLO\FORUM\MPLAB\LCD_COPY.ASM 9 : Symbol not previously defined (_CONFIG1)
Error[108] D:\SEKOLO\FORUM\MPLAB\LCD_COPY.ASM 9 : Illegal character (,)
Halting build on first failure as requested.
----------------------------------------------------------------------
Release build of project `D:\SEKOLO\forum\mplab\lcd_copy.disposable_mcp' failed.
Language tool versions: MPASMWIN.exe v5.37, mplink.exe v4.37, mplib.exe v4.37
Sat Dec 11 13:30:28 2010
----------------------------------------------------------------------
BUILD FAILED
 
Code:
	List	P=16F628a		
	#include	"P16F628a.INC"	
	__config	_PWRTE_ON  & _WDT_OFF & _INTRC_OSC_NOCLKOUT & _BODEN_ON & _LVP_OFF & _CP_OFF & _MCLRE_OFF

I blame me for that one, sorry
Try this code
 
Yeah, there is no errors now. The code I am using I copied it from . I think the way I built the circuit is not the same as that circuit shown on the previous link. Whats wrong with my circuit because there is still no massege displayed.

I changed the code on the configuration part
I introduced
__config _PWRTE_ON & _WDT_OFF & _INTRC_OSC_NOCLKOUT & _BODEN_ON & _LVP_OFF & _CP_OFF & _MCLRE_OFF

insteat of
__config 0x3D18 ;sets the configuration settings (oscillator type etc.)
 

Attachments

  • circuitt.jpg
    75.6 KB · Views: 374
Birdman0_o I wld like to know if you ever use proteus on some of your projects. If so I wld like to know which version are you using. I am using Proteus 7.1. it came to my sense that maybe I should use the new version 7.6. I m still downloading it. after I have instlled it and tested the program I wld let you know. Could you please test mine on your proteus and see what you will get. Thank you very much
 
The resistor should be tied to V+, and a direct wire from Ra4 to the LCD. What you have right now keeps RA4 high all the time, this is bad!
 
good day every one... someone can gave me a circuit diagram and code source, using pic16f877a ask a calculator... for my project in micro-controller... tnx
 
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…