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.

pic16f877a code and Proteus anyone can help

Status
Not open for further replies.
Ya. Let me give a try.
Regards,
Jerin. ;-)

yes BASIC is the easiest way to program microcontroller and already compare mikroBASIC with PROTON IDE..PROTON IDE is more powerful and really easy to use if compare to mikroBASIC...
 

Hi Tahmid-

The compiler which I am using is MicroCode Studio, and I need to write the code in Basic language only.
So I wrote the code and simulated the same in proteus and worked well there. Now when I am loading the same code on the controller, the controller doesn't respond, I suppose this is because I am not setting the configuration bits properly(not written any initialization code). So can you tell me what bits need to be changed or what registers to be modified. This compiler doesn't have the configuration bit setting from the tabs, so I believe I'll have to do it from the program.

Regards
Ankit
 

Hi,
Set it to code protection off, write protection off, debugger disabled, eeprom code protection off, power up timer disabled, watchdog timer disabled and select appropriate crystal type: RC, XT or HS, depending on what you use.
Try:
Code:
@ __CONFIG _XT_OSC & _WDT_OFF & _PWRTE_OFF & _DEBUG_OFF & _CPD_OFF & _CP_OFF

Check this link:
Presetting Configuration Fuses (PIC Defines) into your Program

Hope this helps.
Tahmid.

---------- Post added at 14:26 ---------- Previous post was at 14:05 ----------

yes BASIC is the easiest way to program microcontroller and already compare mikroBASIC with PROTON IDE..PROTON IDE is more powerful and really easy to use if compare to mikroBASIC...

Hi,
I use mikroBASIC because I feel it's easier than Proton. Anyway, Basic may be simple, but it's not bad. The programs I've made in mikroBASIC are more than efficient enough. Plus, the other plus point with mikroBASIC is that it follows the Visual Basic type syntax so it makes the task of moving to microcontrollers very easy for those who know VB. PICBASIC has a different syntax though.
 

Hi,
If you ran across the problem, it's because I don't use it, it's something I found while googling.
Anyway, I think this should do it:
Code:
CONFIG_START
OSC = XT ' Crystal oscillator
FSCM = OFF ' Fail-Safe Clock Monitor disabled
PWRT = OFF ' power on reset Disabled
WDT = OFF ' Disabled
Debug = OFF ' Disabled
CONFIG_END

Hope this helps.
Tahmid.
 

Hi Tahmid-

I figured out the way of writing to set the config bits in basic i.e @ device PIC16F877A, ..........
For my proper understanding can u send me a code written in Basic for pic16F877A(16Mhz) using pin say B.1(here I have a led attached), seeing the program it will be easier for me to understand the initializing parameters and setting config bits.
Compiler I am using is MicroCode Studio.

Regards
Ankit
 

Hi,
Like I said, I don't use MicroCode Studio, so have no idea about it. I can only write it in mikroBASIC. If you can make do with it, then I can help with the code, but in mikroBASIC, setting the config bits is damn easy, you just select your required settings from a drop down menu, nothing to be written in code.

Hope this helps.
Tahmid.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top