Thanks for all your help! Question: can proteous simulate Pic Basic code?? i have proteous but have never used it. unfortunately i am under the gun to get this pic chip stuff working, my thesis demands it and i have no ulternative. any help is appreciated.
using Microcode studio, when i open "blink.bas" i have this code displayed:
' Example program from manual to blink an LED connected to PORTB.0 about once a second
loop: High 0 ' Turn on LED connected to PORTB.0
Pause 3000 ' Delay for .5 seconds
Low 0 ' Turn off LED connected to PORTB.0
Pause 3000 ' Delay for .5 seconds
Goto loop ' Go back to loop and blink LED forever
End
that's it, that's alll it is. when i hit compile it produces an ASM file and a HEX file. the asm file is shown here:
; PicBasic Pro Compiler 2.42, (c) 1998, 2002 microEngineering Labs, Inc. All Rights Reserved.
PM_USED EQU 1
INCLUDE "16F877.INC"
; Define statements.
#define CODE_SIZE 8
RAM_START EQU 00020h
RAM_END EQU 001EFh
RAM_BANKS EQU 00004h
BANK0_START EQU 00020h
BANK0_END EQU 0007Fh
BANK1_START EQU 000A0h
BANK1_END EQU 000EFh
BANK2_START EQU 00110h
BANK2_END EQU 0016Fh
BANK3_START EQU 00190h
BANK3_END EQU 001EFh
EEPROM_START EQU 02100h
EEPROM_END EQU 021FFh
R0 EQU RAM_START + 000h
R1 EQU RAM_START + 002h
R2 EQU RAM_START + 004h
R3 EQU RAM_START + 006h
R4 EQU RAM_START + 008h
R5 EQU RAM_START + 00Ah
R6 EQU RAM_START + 00Ch
R7 EQU RAM_START + 00Eh
R8 EQU RAM_START + 010h
FLAGS EQU RAM_START + 012h
GOP EQU RAM_START + 013h
RM1 EQU RAM_START + 014h
RM2 EQU RAM_START + 015h
RR1 EQU RAM_START + 016h
RR2 EQU RAM_START + 017h
_PORTL EQU PORTB
_PORTH EQU PORTC
_TRISL EQU TRISB
_TRISH EQU TRISC
INCLUDE "BLINK2.MAC"
INCLUDE "PBPPIC14.LIB"
LABEL?L _loop
HIGH?C 000h
PAUSE?C 00BB8h
LOW?C 000h
PAUSE?C 00BB8h
GOTO?L _loop
END?
END
Question: why are there "?" marks in the code??? i open blink.asm with notepad, so it should be showing only pure ascii characters. as you can see in the assembly code the compiler aut0matically includes a file "16F877.inc". this consist of 16F877 setup information. incase it is relevant, i will include the contents of 16F877.inc here:
'****************************************************************
'* 16F877.BAS *
'* *
'* By : Leonard Zerman, Jeff Schmoyer *
'* Notice : Copyright (c) 1998 microEngineering Labs, Inc. *
'* All Rights Reserved *
'* Date : 10/23/98 *
'* Version : 2.11 *
'* Notes : *
'****************************************************************
BANK0 $0020, $007F
BANK1 $00A0, $00EF
BANK2 $0110, $016F
BANK3 $0190, $01EF
EEPROM $2100, $21FF
LIBRARY "PBPPIC14"
DEFINE CODE_SIZE 8
include "PIC14EXT.BAS"
PORTL VAR PORTB
PORTH VAR PORTC
TRISL VAR TRISB
TRISH VAR TRISC
include "PBPPIC14.RAM"
'*-----------------------* EOF 16F877.BAS *---------------------*
when i load up my programmer software, picall, i set the options as follows:
Oscillator: HS
Watchdog timer: OFF
BrownOut Detect: OFF
it also does not work with Watchdog timer: ON
Mr.Cool