no | none of my working programs with external osc will work with int osc
and the described settings.
thats why i wanted info on files to see if it was really getting changed
no | none of my working programs with external osc will work with int osc
and the described settings.
thats why i wanted info on files to see if it was really getting changed
1. Save the following code as MyTest.BAS into your PBP directory...
2. Compile (approx 67 words) by opening up a DOS box, logging into the PBP directory and from it use the command line...Code:' ' Device Programming Options ' -------------------------- @ DEVICE pic16F628, INTRC_OSC_NOCLKOUT ' System Clock Options @ DEVICE pic16F628, WDT_ON ' Watchdog Timer @ DEVICE pic16F628, PWRT_ON ' Power-On Timer @ DEVICE pic16F628, BOD_ON ' Brown-Out Detect @ DEVICE pic16F628, MCLR_OFF ' Master Clear Options (Internal) @ DEVICE pic16F628, LVP_OFF ' Low-Voltage Programming @ DEVICE pic16F628, CPD_OFF ' Data Memory Code Protect @ DEVICE pic16F628, PROTECT_OFF ' Program Code Protection ' ' Hardware Assignments ' -------------------- LEDA var PortA.0 LEDB var PortB.0 ' ' Initialise PIC ' -------------- TRISA=%00000000 ' PortA all OUTPUT TRISB=%00000000 ' PortB all OUTPUT CMCON=%00000111 ' Comparators OFF ' ' Main Program ' ------------ Loop: Toggle LEDA Pause 500 Toggle LEDB Pause 500 Goto Loop ' End
PBP -p16F628 MyTest -v
3. Program your PIC...
Results...
1. If it fails to Compile you have a bum PBP installation
2. If it fails to compile you may not have logged into your PBP directory
3. If it compiles but doesn't program you have a bum programmer/software
4. If the PIC does not run, your programmer may have changed the CONFIG Fuse Settings - check this before you hit the BURN Button...
5. If the PIC does not run you have a Bad PIC or have forgotten to pay your electric company.
6. I'm making assumptions you can wire Vss and Vdd to your PIC (MCLR or xtal/resonator not required), and that you can hang an couple of LEDs with a Series Resistors (any value between 180R-390R) between the approprate PIC pin and Vss (or Vdd), and you can figure which way around to nail it.
A program compiled for a 16F628 will happilly burn into an 'A' version without needing recompilation.
your a sweetheart. it works fine using this method
now for the million dollar question why??/
dont know what to do to get it to function out of microstudio
any help?//\
thanks
when i tried using my old method microstudio on this program
got many errors illegal opcode found label after colum one
error 122 warning 207 so dont know whats going on
have tried to reinstall the software many many many times??/
hate to have to learn how to do this in dos
tried doing this not using mpasm and worke fine but dont know how i got here
but it did work
>your a sweetheart.
I know.
>it works fine using this method now for the million dollar question why??/
Because I programmed it.
>dont know what to do to get it to function out of microstudio
Neither do I - I don't use those things...
>any help?//\
Not with Microcode studio
>thanks
You're welcome
Now let's move on and get your LCD working... connect it as per Page 96 of the manual, copy and save the below code, and compile as before... Remove the LED from PortA.0 but keep the one on PortB.0 - the blinking LED is there to tell you it's all working...
Code:' ' Device Programming Options ' -------------------------- @ DEVICE pic16F628, INTRC_OSC_NOCLKOUT ' System Clock Options @ DEVICE pic16F628, WDT_ON ' Watchdog Timer @ DEVICE pic16F628, PWRT_ON ' Power-On Timer @ DEVICE pic16F628, BOD_ON ' Brown-Out Detect @ DEVICE pic16F628, MCLR_OFF ' Master Clear Options (Internal) @ DEVICE pic16F628, LVP_OFF ' Low-Voltage Programming @ DEVICE pic16F628, CPD_OFF ' Data Memory Code Protect @ DEVICE pic16F628, PROTECT_OFF ' Program Code Protection ' ' Hardware Assignments ' -------------------- LEDB var PortB.0 ' ' LCD Display ' ----------- Define LCD_DREG PORTA ' Port for LCD Data Define LCD_DBIT 0 ' Use upper 4 bits of Port Define LCD_RSREG PORTA ' Port for RegisterSelect (RS) bit Define LCD_RSBIT 4 ' Port Pin for RS bit Define LCD_EREG PORTB ' Port for Enable (E) bit Define LCD_EBIT 3 ' Port Pin for E bit Define LCB_BITS 4 ' Using 4-bit bus Define LCD_LINES 2 ' Using 2 line Display Define LCD_COMMANDUS 2000 ' Command Delay (uS) Define LCD_DATAUS 50 ' Data Delay (uS) ' ' Initialise PIC ' -------------- TRISA=%00000000 ' PortA all OUTPUT TRISB=%00000000 ' PortB all OUTPUT CMCON=%00000111 ' Comparators OFF Pause 2000 ' wait for LCD to wake-up ' ' Main Program ' ------------ Loop: LCDOut $FE,1,"Hello" Pause 500 LCDOut $FE,1 Toggle LEDB Pause 500 Goto Loop ' End
Still Having Lcd Problems But At Least The Chip Is Now Functioning
Led Flashing Will Trace Out And Maybe Find Whats Hapeing With It
Again Thanks
Will Advise On Progress
Wow Beauty And Brains
Got It Working Thanks Thanks
Now The 2 Million Dollar Question (no Not That One)
Where Do You Get Manuals For What Your Doing Does Not Seem To Be Whats Happeing With What I Purchased
Well tell me what you purchased...
On my part I'm using PBP2.46 with the latest patches taken from the MeLabs website. The manuals are what comes with the product or again downloaded from the MeLabs website. The DATASHEETS for the PICs come from the Microchip Website. I do not use Microcode studio. All code in my examples comes from the Manual or the Datasheet. You should have EXACTLY the same as I have - except you additionally have MCS which dosen't turn me on.
I also look at what the installation disks have put on my PC. There's stuff to be learnt from that... Readme files and documentation and examples... look and learn...
Bookmarks