Here is the test code:
Code:
include <p16c745.inc>
__CONFIG _CP_OFF & _WDT_ON & _PWRTE_ON & _H4_OSC
org 0
movlw B'00000010'
tris PORTA
movlw B'00000100'
movwf PORTA
fin: goto fin
end
compliled:
Code:
[root@horse from-other-pdf]# gpasm -p p16c745 1.asm
1.asm:7:Warning [224] Use of this instruction is not recommended.
[root@horse from-other-pdf]# gpsim -p p16c74 1.hex
simulated:
It turn on the led on the simulator.
Code:
[root@horse from-other-pdf]# gpsim -p p16c74 1.hex
gpsim - the GNUPIC simulator
version: Release 0.26.1
type help for help
**gpsim> SimulationMode:52
FIXME gui_breadboard.cc Build
SetProcessorByType FIXME
Extended linear address 0 0
Leaving pic_processor::LoadProgramFile
running...
WDT expired reset
0x0000000000AFC7FF p16c74 0x0000 0x3002 movlw 0x02
Wrote: 0x0008 to status(0x0003) was 0x0008
Wrote: 0x00FF to option_reg(0x0081) was 0x00FF
Wrote: 0x0000 to pcl(0x0002) was 0x0000
Exiting gpsim
[root@horse from-other-pdf]#
HEX loaded on pickit(pic16c745)
Code:
[root@horse from-other-pdf]# usb_pickit.Linux.i386 --program 1.hex
Locating USB Microchip(tm) PICkit(tm) (vendor 0x04d8/product 0x0032)
Found USB PICkit as device '012' on USB bus 005
Communication established. Onboard firmware version is 2.0.2
PIC12F675 Rev 16 found
.hex file contains a configuration word
Writing 0 eeprom words
Writing 5 program words
.....
Calculated Checksum from .hex file: 0x06f0
Checksum from PICKit: 0x06f0
Checksums are equal. Device Programming Successful.
....
[root@horse from-other-pdf]#
It does not turn on the LED.