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.

help pic16f877a using mikrobasic

Status
Not open for further replies.

sheth_ka

Junior Member level 2
Joined
Aug 29, 2009
Messages
21
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Activity points
1,427
mikrobasic interrupt

hello,im a newbie on using pic16f877a,im familiar with pic16f84a but i got problem on pic16f877a..right now im using basic programming language (mikrobasic compiler)..

now i could only manage to manipulate the led blinking using pic16f877a,but i cannot add inputs like switches..i am currently developing a timer circuit using this pic16f877a..it is a 10min timer..in which it should have a pause, start, and reset switches..

on my ckt, i use 74LS247(decoder) combined with pic16f877a..i use the portB and portD of pic16f877a as output,then connect it into four 74LS247 to decode it for seven-segment display..

now my biggest problem is how can i add pause, start, and reset switches..my current progress is the straight count down of 10min timer..

im looking forward to anyone for reply..thanks!:|
 

mikrobasic blink led

Hello Sheth_ka!
Well the type of application that you are designing requires the use of interrupts. For using three switches for start reset and pause you will have to use the 4 pins of port b <7:4> which are used as the port b change interrupt pins. Any change detected on these pins will stop the program and jump to the specified vector and this will require you to remove the 7 seg display connected to your port b and shift it to port c or a (make sure you use port a as digital i/o port)
For a newbie to pic16f877 "Interfacing Pic Microcontrollers by Martin Bates" is the best. If you donot have the book just drop your email address and ill send it you.
Good Luck!
 

using timer in microbasic

Hi SHETH_ka, if you using mikrobasic probably you visit mikroe.com, there you have free books to download, all you'r "problem" is there explained,
regards
 

pic16f877 + mikrobasic

pasicr said:
Hi SHETH_ka, if you using mikrobasic probably you visit mikroe.com, there you have free books to download, all you'r "problem" is there explained,
regards


yeah..ive already visit their site..ive downloaded the manual of the software..but still i cant understand some of the syntax..although it is somehow similar to microsoft visual basic..there something missing on their explaination,i dont know..anyway thanks for the reply..

Added after 28 minutes:

sk_008 said:
Hello Sheth_ka!
Well the type of application that you are designing requires the use of interrupts. For using three switches for start reset and pause you will have to use the 4 pins of port b <7:4> which are used as the port b change interrupt pins. Any change detected on these pins will stop the program and jump to the specified vector and this will require you to remove the 7 seg display connected to your port b and shift it to port c or a (make sure you use port a as digital i/o port)
For a newbie to pic16f877 "Interfacing Pic Microcontrollers by Martin Bates" is the best. If you donot have the book just drop your email address and ill send it you.
Good Luck!

hi, thanks for the reply..so i need to transfer my 7segdisplay from portb to a..and use the port b as input..thanks, ill try that..but the problem is..i dont know how to code it..ive attached pics of my code written in mikrobasic and the schematic diagram..please do see that..i haven't code the interrupts yet coz i dont know the syntax for it..

by the way im also interested on the book you have said..i would be glad if you send me a copy of that here's my email add..sheth_ka@yahoo.com:D
 

how to use interrupts in pic 16f877a

Well Sheth_ka!
Why don't you use the multiplexing technique its easy and you will have your number of pins reduced too at the moment you have got 16 pins connected to your 7 segemnts by using multiplexing you will have just 7 for 7 seg and 4 pins for enabling your desired 7 seg that makes 11 pins
Have a look at this https://picnote.blogspot.com/2008/12/led-7-segment-multiplexing.html
I've sent you some others books too along with the one that i mentioned
Well i've got experience in coding in c or assembly but i think if you have a sample code in c or assembly there will be no problem in dealing with basic your code for timer seems to be very neat i think you will just have to introduce a fuction for 7 segment multiplexed display, introduce interrupts for your switches to be pressed and a timer interrupt too for your 10 minute timer because you know you're making your controller to do two different things at a time first a timer going on and polling your switches at the same time whether one of them is pressed or not and if pressed then controller should switch to the desired operation.
I suggest that you should give 2 or 3 days and study multiplexing and interrupts when you become familiar with the working of interrupts and multiplexing technique i'll definitely help you with the code but you know i have got no experience in picbasic but i'll show you the handling of interrupts in assembly or c and you'll be able to do in basic
Good Luck!
 

mikrobasic codes for pic16f877a

sk_008 said:
Well Sheth_ka!
Why don't you use the multiplexing technique its easy and you will have your number of pins reduced too at the moment you have got 16 pins connected to your 7 segemnts by using multiplexing you will have just 7 for 7 seg and 4 pins for enabling your desired 7 seg that makes 11 pins
Have a look at this https://picnote.blogspot.com/2008/12/led-7-segment-multiplexing.html
I've sent you some others books too along with the one that i mentioned
Well i've got experience in coding in c or assembly but i think if you have a sample code in c or assembly there will be no problem in dealing with basic your code for timer seems to be very neat i think you will just have to introduce a fuction for 7 segment multiplexed display, introduce interrupts for your switches to be pressed and a timer interrupt too for your 10 minute timer because you know you're making your controller to do two different things at a time first a timer going on and polling your switches at the same time whether one of them is pressed or not and if pressed then controller should switch to the desired operation.
I suggest that you should give 2 or 3 days and study multiplexing and interrupts when you become familiar with the working of interrupts and multiplexing technique i'll definitely help you with the code but you know i have got no experience in picbasic but i'll show you the handling of interrupts in assembly or c and you'll be able to do in basic
Good Luck!

i appreciate your advice of using multiplexers, i'd also visited the site you've included,but i need to use common anode 7seg display however multiplexers requires common cathode 7seg display, so it wont be applicable in my situation..thanks for the ebooks by the way..theyre all good..i have some time reading them..i wonder if you have PICBasic software or knows where to download its full version..hope you dont mind,but if you have sample code that applies switches or interrupts with pic16f877a, please send me that,it would be a big help for me while studying the pic16f877a..and also please include the schematic diagram for the hardware connections..thanks again..
 

using 2 timers pic16f877

Multiplexers work with common cathode or common anode displays, you just reverse the drive signals to them.

Brian.
 

program- mikrobasic- seven seg

Well sheth_ka I am attaching the Crownhill Proton IDE some of my fellows have used it and they found it good. I don't know whether its a full version or just an evaluation version you just check it up hope that it might help you i'll send you the schematic for multiplexing four 7 seg displays too and some programs but they're in assembly if you want them i'll send them to you
The book "Pic Basic Projects" contains a project in which multiplexing is involved its number is 14 so check that out too only you will have to add up two more displays in the similar way. Betwixt is right common anode and cathode both work i've used both of them as multiplexed displays.
 
using mikrobasic

yeah sure just send them to me, i wanna see the schematic and sample code that you have..
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top