Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] so now what am I doing wrong (trying to use INTOSC)

Status
Not open for further replies.

techristian

Member level 1
Joined
Apr 3, 2013
Messages
41
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Location
Windsor, Ontario
Activity points
1,611
so now what am I doing wrong (trying to use INTOSC)????

I HAVE NO CRYSTALS YET. So I'm using INTOSC. I'm not expecting the segments to make any sense at this point. I just want to display different patterns on a single DIGIT 7 segment display. I have set up PORTC to power it and I'm trying to drive it directly from PORTC without buffering to memory.

Right now, when I power up the PIC16F1784 NOTHING HAPPENS !

Disassembly Listing for 7segmentledinASM_16f1784
Generated From:
/home/dan/Desktop/MPLABX/test/7segmentledinASM_16f1784/dist/PIC16F1784/production/7segmentledinASM_16f1784.production.cof
30-Apr-2013 12:00:55 AM

--- /home/dan/Desktop/MPLABX/7segment.asm -------------------------------------------------------------
1: #include <p16f1784.inc>
2:
3: ;CONFIG1
4: ; __config 0x3FE4
5: __CONFIG _CONFIG1, _FOSC_INTOSC & _WDTE_OFF & _PWRTE_OFF & _MCLRE_ON & _CP_OFF & _CPD_OFF & _BOREN_ON & _CLKOUTEN_OFF & _IESO_ON & _FCMEN_ON
6: ; CONFIG2
7: ; __config 0x3FFF
8: __CONFIG _CONFIG2, _WRT_OFF & _VCAPEN_OFF & _PLLEN_ON & _STVREN_ON & _BORV_LO & _LPBOR_OFF & _LVP_ON
9:
10: delay equ 0x2d
11: digit equ 0x2d
12: digmask equ 0x2e
13: value equ 0x2f
14:
15: org 0x0000
0000 2805 GOTO 0x5 16: goto start
17:
18: org 0x004
0004 281A GOTO 0x1A 19: goto dummyINT
20:
21: start
22:
23:
24:
25:
26:
27:
28:
29:
30:
0005 3000 MOVLW 0x0 31: movlw b'00000000' ;MOVE ZERO TO ACC "W"orking register
32:
33:
36:
37:
38:
39: loop
0008 3024 MOVLW 0x24 40: movlw b'00100100' ;one
0009 008E MOVWF PORTC 41: movwf PORTC
000A 2015 CALL 0x15 42: call d250
43:
000B 302E MOVLW 0x2E 44: movlw b'00101110' ;four
000C 008E MOVWF PORTC 45: movwf PORTC
000D 2015 CALL 0x15 46: call d250
47:
000E 306D MOVLW 0x6D 48: movlw b'01101101' ;three
000F 008E MOVWF PORTC 49: movwf PORTC
0010 2015 CALL 0x15 50: call d250
51:
0011 3000 MOVLW 0x0 52: movlw b'00000000' ;blank
0012 008E MOVWF PORTC 53: movwf PORTC
0013 2015 CALL 0x15 54: call d250
55:
56:
57: ;loop forever
0014 2808 GOTO 0x8 58: goto loop
59:
60:
61:
62: d250
0015 3052 MOVLW 0x52 63: movlw 0x52 ;loop 52 times ?
0016 00AD MOVWF 0x2D 64: movwf delay
0017 0BAD DECFSZ 0x2D, F 65: l250 decfsz delay,f
0018 2817 GOTO 0x17 66: goto l250
0019 0008 RETURN 67: return
68:
69:
70:
71:
72:
001A 0009 RETFIE 73: dummyINT retfie
74:
8007 0000 NOP 75: end


- - - Updated - - -

Ok I just noticed something here.

MY TRIS COMMANDS ARE GONE.

I put them in lines 34 and 35 but they don't show up in the disassembly.
TRIS 5 ;set PortA all outputs
TRIS 7 ;set PortC all outputs

Dan
 
Last edited:

TRIS 5 ;set PortA all outputs
TRIS 7 ;set PortC all outputs
Did you selected bank1 where it resides? Error level 302 gives an error if it not suppressed.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top