Ok I guess I'm just an idiot but...

Status
Not open for further replies.

psecody

Member
I got a EasyPIC 4 and guess what? Its not real easy. I installed the program like the instructions say then I plugged in the board but nothing showed up, it was supposed to recognize it and ask for drivers. I removed the PIC16F877A that came on the board and it recognized the board then. So I told it where the drivers were and got that set up then I plugged in the chip again to try and program and the computer just popped up and said I removed the hardware...so anyway I don't know how I did it but I finally got the thing to run with the chip on there, the only problem now is I think I deleted the program it came with on it because now it wont flash the led's like it was. And every time I try to read or write to the pic I get these messages: Error Call to device driver, a device attached to the system is not functioning. Then Erroo call to device driver, the device does not recognize this command. Then error call to device driver, the handle is not valid. then error trying to send data to programmer. and finally programming failed, program 25 errors, eeprom o errors, ids 0 errors. This is confusing me because I have no clue what is wrong, I thought the code maybe but it compiled just find in the microchip software, no errors or anything. What am I doing wrong? I appreciate any help.
 
I had to Uninstall and Reinstall the picbasic first and then when that is done installing it automatically asks if you want to install picflash which is yes.
 
I'm not using one of their compilers because I'm programming in assembly...so far I've just been trying to get some of their examples to run, which they do on the family computer but I need it to work on my laptop which is the one I'm having trouble with. It didn't work flawlessly on the desktop but it would atleast respond alittle more
 
Often times with programmers that work over USB (have several different ones, so don't recall if I have this problem with the EasyPIC4, think I probably do as it's pretty universal), once I unplug it from a USB port, it won't work again on that same USB port until I reboot often. So I have to plug it into a different USB port or reboot the machine. When unplugging and plugging USB devices, I like to wait a minute after unplugging it before plugging it back in, seems to make things smoother. Also, I often exit the application, then plug the device in and then restart the application, in case it has something it needs to initialize on start up.
With the EasyPIC4 board I found that I could not program the chip if the board had its jumper set to be powered from USB. I changed it to DC power and have both the USB and DC cables plugged in and then I could program the chip just fine.
 
Your USB ports may not be able to handle the load if you're powering your easyPIC4 from the USB port, Your USB ports WILL shut down and reset if too much current is drawn. This is especially true for LCD backlights...
My Unicorn USB design shows the same thing with high current devices. The fix is the same (use Inchworms power supply)
 
Yeah I figured that out yesterday..I just thought it might be my laptop so I installed it on the family desktop and it worked ok but it still wowuldn't work half of the time. So later that night I was thinking what did that computer have that my laptop didn't have anc then it dawned on me that it had a bigger power supply so I connected a power supply to the programmer and it worked like a charm. Now the only thing is I can't get programs that I write to work on it. All their examples work perfectly but mine wont. I even copied and pasted Nigels code on his website for the led's and modified it (changed picwhatever to pic16f877a) and it still wouldn't work. I'm programming in assembly I just write the code in mplab or notepad then make a hex file out of them then load the hex file through picflash but I cant get the board to respond... I don't know whats going on. I would give you my code that I'm trying to get running but its on my windows partition and I don't have time to restart(I'm on osx right now) and all that because I'm fixing to have to leave for work. But I'll post them later..
 
no I run windows natively with bootcamp, I've got a legitimate copy of windows xp pro installed on it.
I have a MacBook Pro and have both osx and windows partitions and also have linux on my external hardrive. None of the electronics programs work on mac so I have to use windows for that but for everything else its straight osx because its like 10x less stressful, it actually just works. Actually the only reason I got xp on there was to play The Elder Scrolls IV: Oblivion. I wanted osx but wanted to be able to play that game then when I learned Macs could run either or the chioice was simple. I basically bought my laptop to play that game haha.
 
Last edited:
Ok I've got the following code and as hard as I try I can't get anything to respond on my programmer. The EasyPIC 4 has LED's that are supposed to show the status of the pins but nothing lights up. Can someone tell me what I've done wrong because I just don't see it. Thanks

Code:
	list		p=16f877A	; list directive to define processor
	#include	<p16f877A.inc>	; processor specific variable definitions
	
	__CONFIG _CP_OFF & _WDT_OFF & _BODEN_OFF & _PWRTE_ON & _RC_OSC & _WRT_OFF & _LVP_ON & _CPD_OFF

; '__CONFIG' directive is used to embed configuration data within .asm file.
; The lables following the directive are located in the respective .inc file.
; See respective data sheet for additional information on configuration word.

;***** VARIABLE DEFINITIONS
		; variable used for context saving 
TRISC equ 87h		; variable used for context saving
PORTC equ 07h		; variable used for context saving			
COUNT1 equ 20h
COUNT2 equ 21h

	
;**********************************************************************
	ORG     0x000             ; processor reset vector
	BSF 03h, 5
	BCF 03h, 6 
	MOVLW b'00000000'
	MOVWF 87h
	BCF 03h, 5
	BCF 03h, 6
;********************************************************************
START MOVLW b'11111111'
	MOVWF PORTC	
	GOTO START
	
	END                       ; directive 'end of program'
 
You've got an include file so you don't need to define the PORTC & TRISC

This code will work, assuming you're using a simple _RC_OSC instead of a crystal, if you're using crystal try _XT_OSC or _HS_OSC instead. I've also modified it to light even bits on PORTC

PS your old code may also work, if so it's most likely your Mac emulation is not perfect, try it on a real XP machine before you give up on it.

Code:
    list        p=16f877A    ; list directive to define processor
    #include    <p16f877A.inc>    ; processor specific variable definitions

    __CONFIG _CP_OFF & _WDT_OFF & _BODEN_OFF & _PWRTE_ON & _RC_OSC & _WRT_OFF & _LVP_ON & _CPD_OFF
;**********************************************************************
    ORG     0x000             ; processor reset vector
    bsf    STATUS, RP0    ;B1
    MOVLW     b'00000000'    ;B1
    MOVWF     TRISC        ;B1 all outputs on PORTC
    bcf    STATUS, RP0    ;B0
;********************************************************************
    MOVLW  b'01010101'
    MOVWF  PORTC
    GOTO   $            ; loop forever
    END
 

Attachments

  • LED.png
    5.9 KB · Views: 160
Last edited:
I'm not emulating windows on my machine, its running natively. Macs can now boot windows. But thanks I'll go try that code and see if it works, I think the oscillator may have been the problem because if my memory is correct there was a jumper set on the board that enabled the use of the crystal oscillator

edit: I got it to work, I changed the _RC_OSC to _HS_OSC and it works. But what does HS stand for, I know that XT would be eXTernal but HS doesn't ring a bell.
 
Last edited:
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…