Welcome to Mandalay Technological University Forum
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Welcome to Mandalay Technological University Forum

ဴမန္မာအင္ဂဵင္နီယာမဵားဖိုရမ္
 
HomePortalGallerySearchLatest imagesRegisterLog in

 

 PIC Microcontroller

Go down 
3 posters
AuthorMessage
kyawmyo
Admin
Admin
kyawmyo


Male
Number of posts : 66
Age : 45
Location : Singapore
Occupation : Service Engineer
Batch if MIT (if not simply fill YIT) : 7th
Registration date : 2006-10-22

PIC Microcontroller Empty
PostSubject: PIC Microcontroller   PIC Microcontroller Icon_minitimeMon Oct 23, 2006 9:39 am

PIC microcontroller

PIC is a family of RISC microcontrollers made by Microchip Technology, derived from the PIC1650 originally developed by General Instrument's Microelectronics Division.
Microchip Technology does not use PIC as an acronym; in fact the brand name is PICmicro. The original PIC was built to be used with GI's new 16-bit CPU, the CP1600. While generally a good CPU, the CP1600 had poor I/O performance, and the 8-bit PIC was developed in 1975 to improve performance of the overall system by offloading I/O tasks from the CPU. The PIC used simple microcode stored in ROM to perform its tasks, and although the term wasn't used at the time, it is a RISC design that runs one instruction per cycle (4 oscillator cycles).
In 1985 General Instruments spun off their microelectronics division, and the new ownership cancelled almost everything — which by this time was mostly out-of-date. The PIC, however, was upgraded with EPROM to produce a programmable channel controller, and today a huge variety of PICs are available with various on-board peripherals (serial communication modules, UARTs, motor control kernels, etc.) and program memory from 512 words to 32k words and more (a "word" is one assembly language instruction, varying from 12, 14 or 16 bits depending on the specific PIC micro family).
Back to top Go down
Kyaw Naing Oo
LEVEL '1'
LEVEL '1'
Kyaw Naing Oo


Male
Number of posts : 27
Age : 43
Location : Singapore
Occupation : Application Engineer
Batch if MIT (if not simply fill YIT) : 8th Batch
Registration date : 2006-10-25

PIC Microcontroller Empty
PostSubject: Re: PIC Microcontroller   PIC Microcontroller Icon_minitimeThu Nov 16, 2006 6:51 am

Hello Ko Kyaw Myo and all,
Now I faced some difficulties in programming PIC-C languages. I am cannot utilize Interrupts. Be hornestly I am not so clear how to write down to call interrupts and when i need to call it. Moreover, could you pls explain me or giv some examples programs in Assembly code of full projects about utilizing Timer-1 Overflow and how to manage it? I am looking forward to hear from u!

Thanks and Regards,
Kyaw Naing Oo.
Back to top Go down
kyawmyo
Admin
Admin
kyawmyo


Male
Number of posts : 66
Age : 45
Location : Singapore
Occupation : Service Engineer
Batch if MIT (if not simply fill YIT) : 7th
Registration date : 2006-10-22

PIC Microcontroller Empty
PostSubject: Re: PIC Microcontroller   PIC Microcontroller Icon_minitimeThu Nov 16, 2006 1:38 pm

Hi,
Interrupts are a mechanism of a microcontroller which enables it to respond to some events at the moment they occur, regardless of what microcontroller is doing at the time. This is a very important part, because it provides connection between a microcontroller and environment which surrounds it. Generally, each interrupt changes the program flow, interrupts it and after executing an interrupt subprogram (interrupt routine) it continues from that same point on.
Control register of an interrupt is called INTCON and can be accessed regardless of the bank selected. Its role is to allow or disallowed interrupts, and in case they are not allowed, it registers single interrupt requests through its own bits.
There are 8 bits in INTCON register:
Bit 7 GIE: Global Interrupt Enable bit
Bit 6 PEIE: Peripheral Interrupt Enable bit
Bit 5 T0IE: TMR0 Overflow Interrupt Enable bit
Bit 4 INTE: RB0/INT External Interrupt Enable bit
Bit 3 RBIE: RB Port Change Interrupt Enable bit
Bit 2 T0IF: TMR0 Overflow Interrupt Flag bit
Bit 1 INTF: RB0/INT External Interrupt Flag bit
Bit 0 RBIF: RB Port Change Interrupt Flag bit

You need to understand well INTCON register and PIR1 register to use TMR 1 overflow interrupt. Then you can control what you want by an interrupt routine.
Here is an example to use TMR1 overflow for PIC16F877 MCU.
This code demonstrates how to use TMR1 for interrupts. Program toggles LEDs on PORTB.
(Very Happy I am not familiar with Assembly Language. So….) But you can change to assembly language by using Register Value from my program.

unsigned short cnt;
unsigned char tb;

void interrupt() {
cnt++ ;
PIR1.TMR1IF = 0; // clear TMR1IF
}//~

void main()
{
TRISB = 0;
T1CON = 1;
PIR1.TMR1IF = 0; // clear TMR1IF
PIE1 = 1; // enable interrupts
PORTB = 0xF0;
cnt = 0; // initialize cnt
INTCON = 0xC0;

do {
if (cnt == 152) { // if cnt is 152, then toggle portb leds and
PORTB = ~PORTB; // reset cnt
cnt = 0;
}
} while (1);
}//~!

I hope it will help you.
Regards,
KM
Back to top Go down
YanNaingAye
LEVEL '3'
LEVEL '3'
YanNaingAye


Male
Number of posts : 89
Age : 48
Location : Singapore
Occupation : Firmware Engineer
Registration date : 2006-10-25

PIC Microcontroller Empty
PostSubject: example   PIC Microcontroller Icon_minitimeThu Nov 16, 2006 2:21 pm

Here is the assembly code example from microchip

http://ww1.microchip.com/downloads/en/deviceDoc/intrp.zip

Hee hee... I've no experience in PIC. I'll try to explain this program as I thought. You should think before you accept it. heee hee... Hope it will help you a little. Correct me if I'm wrong.

1). It doesn't need to call Interrupt routine from main routine.
need to initialize registers before entering main loop.
MLOOP
goto MLOOP

That example code is looping without doing anything.

2). Need to set up interrupt vector table with the routine to be called

org 0x000008 ; high priority interrupt vector
bra TMR1_ISR

That code makes TMR1_ISR be pointed. You can give any name instead of TMR1_ISR.

3). After step 2, TMR1_ISR will be call when timer1 is time out. You need to set up time out interval (the number of count) in timer 1.

;Timer1 setup
clrf T1CON
clrf TMR1H ;clear Timer1 high
clrf TMR1L ;clear Timer1 low
bsf T1CON,TMR1ON ;turn on Timer1

I don't know registers in the PIC. Hope you understand it. Crystal frequency is needed to take into account.

4). Define what to do in interrupt routine.

TMR1_ISR
.................
retfie

ရီြွး ၾကည့္တာ။ ခ်င့္ခ်ိန္ျပီးမွယံု။ ဟီး....

For Hi-Tech C, you can download manual in following link

http://www.htsoft.com/downloads/manuals.php
Back to top Go down
http://yan9aye.blogspot.com/
Kyaw Naing Oo
LEVEL '1'
LEVEL '1'
Kyaw Naing Oo


Male
Number of posts : 27
Age : 43
Location : Singapore
Occupation : Application Engineer
Batch if MIT (if not simply fill YIT) : 8th Batch
Registration date : 2006-10-25

PIC Microcontroller Empty
PostSubject: Re: PIC Microcontroller   PIC Microcontroller Icon_minitimeThu Nov 16, 2006 8:54 pm

Hi Ko Kyaw Myo & Ko Yan,
Thanks for ur supports!! I think i can try on this. I will read through and I can understand, i thinks. Thanks a lot!

Best Regards,
Kyaw Naing Oo.
Back to top Go down
Kyaw Naing Oo
LEVEL '1'
LEVEL '1'
Kyaw Naing Oo


Male
Number of posts : 27
Age : 43
Location : Singapore
Occupation : Application Engineer
Batch if MIT (if not simply fill YIT) : 8th Batch
Registration date : 2006-10-25

PIC Microcontroller Empty
PostSubject: Re: PIC Microcontroller   PIC Microcontroller Icon_minitimeFri Nov 17, 2006 11:54 am

Thanks again Ko Kyaw Myo & Ko Yan,

Now I read through and understand it. Thanks for sharing ur knowledges to me. Ko Yan's code also rite, I think, hee hee. For me, I just started learning in PIC and made self-study with example programs. So I i don't know clearly PICC programming can handle register bit directly. Now Ko Kyaw Myo cleared my suspects. Thanks all! Ko Ko Yan, because of ur taught in 5th year, now I can understand PIC Assembly code well. Thanks for ur support to us. It is very valuable to me!!!!

Best Regards,
Kyaw Naing Oo.
Back to top Go down
kyawmyo
Admin
Admin
kyawmyo


Male
Number of posts : 66
Age : 45
Location : Singapore
Occupation : Service Engineer
Batch if MIT (if not simply fill YIT) : 7th
Registration date : 2006-10-22

PIC Microcontroller Empty
PostSubject: Re: PIC Microcontroller   PIC Microcontroller Icon_minitimeFri Nov 17, 2006 4:12 pm

Hi Kyaw Naing Oo,
I forget to tell you that I used MikroC compiler to compile above C code. If you have idea to use more powerful compiler for PIC with C language, I want you to try MikroC compiler from
http://www.mikroe.com/en/compilers/mikroc/pic/

You can also get crack file from net for that compiler.

Regards,
Kyaw Myo
Back to top Go down
Kyaw Naing Oo
LEVEL '1'
LEVEL '1'
Kyaw Naing Oo


Male
Number of posts : 27
Age : 43
Location : Singapore
Occupation : Application Engineer
Batch if MIT (if not simply fill YIT) : 8th Batch
Registration date : 2006-10-25

PIC Microcontroller Empty
PostSubject: Hi Ko Kyaw Myo   PIC Microcontroller Icon_minitimeTue Nov 21, 2006 9:00 pm

do U mean i can get full version from this site? I mean with the crack file. If so it will be very useful, hee hee!!!
Thanks!!!!
Best Regards,
Kyaw Naing Oo.
Back to top Go down
kyawmyo
Admin
Admin
kyawmyo


Male
Number of posts : 66
Age : 45
Location : Singapore
Occupation : Service Engineer
Batch if MIT (if not simply fill YIT) : 7th
Registration date : 2006-10-22

PIC Microcontroller Empty
PostSubject: Re: PIC Microcontroller   PIC Microcontroller Icon_minitimeWed Nov 29, 2006 12:49 pm

Bro,
You can get full version of Mikroc from www.sonsivri.com. This is a forum and you need to register to access that site. Try it.

KM
Back to top Go down
Kyaw Naing Oo
LEVEL '1'
LEVEL '1'
Kyaw Naing Oo


Male
Number of posts : 27
Age : 43
Location : Singapore
Occupation : Application Engineer
Batch if MIT (if not simply fill YIT) : 8th Batch
Registration date : 2006-10-25

PIC Microcontroller Empty
PostSubject: Thanks!   PIC Microcontroller Icon_minitimeWed Nov 29, 2006 1:34 pm

Thanks Ko Kyaw Myo, I will try it.

Regards,
Kyaw Naing Oo.
Back to top Go down
YanNaingAye
LEVEL '3'
LEVEL '3'
YanNaingAye


Male
Number of posts : 89
Age : 48
Location : Singapore
Occupation : Firmware Engineer
Registration date : 2006-10-25

PIC Microcontroller Empty
PostSubject: New 32 bit PIC microcontroller   PIC Microcontroller Icon_minitimeFri Jul 20, 2007 9:07 am

I heard a news from one of Microchip's engineers that new 32 bit PIC microcontroller will be launched by Microchip in coming October. Microcontrollers are becoming more and more powerful. Smile Anyway, it is good news for designer. At least more choices to choose...
Back to top Go down
http://yan9aye.blogspot.com/
YanNaingAye
LEVEL '3'
LEVEL '3'
YanNaingAye


Male
Number of posts : 89
Age : 48
Location : Singapore
Occupation : Firmware Engineer
Registration date : 2006-10-25

PIC Microcontroller Empty
PostSubject: PIC + & -   PIC Microcontroller Icon_minitimeFri Aug 03, 2007 7:53 am

- It is said that there is no compatibility between different PIC and need to rewrite code when we move from one PIC to another. In 8051 microcontroller, we don't even need to recompile and we can normally use hex file for one MC in another MC even from different company. Very Happy
+ Many say that we normally use C language and just need to modify some setting at higher level and uncompatibility is not much issue. And another + is MC designers don't need to care compatibility and MC architecture is efficient and elegant.

Efficiency or Compatibility? What will you choose?
Back to top Go down
http://yan9aye.blogspot.com/
YanNaingAye
LEVEL '3'
LEVEL '3'
YanNaingAye


Male
Number of posts : 89
Age : 48
Location : Singapore
Occupation : Firmware Engineer
Registration date : 2006-10-25

PIC Microcontroller Empty
PostSubject: Re: PIC Microcontroller   PIC Microcontroller Icon_minitimeFri Aug 03, 2007 7:57 am

Ref-
http://www.olimex.com/dev/index.html
Back to top Go down
http://yan9aye.blogspot.com/
YanNaingAye
LEVEL '3'
LEVEL '3'
YanNaingAye


Male
Number of posts : 89
Age : 48
Location : Singapore
Occupation : Firmware Engineer
Registration date : 2006-10-25

PIC Microcontroller Empty
PostSubject: Re: PIC Microcontroller   PIC Microcontroller Icon_minitimeFri Aug 03, 2007 7:58 am

+ PIC uses harvard architecture, i.e., different buses for code and data memory.
- Some say PIC has only one working register.
Back to top Go down
http://yan9aye.blogspot.com/
kyawmyo
Admin
Admin
kyawmyo


Male
Number of posts : 66
Age : 45
Location : Singapore
Occupation : Service Engineer
Batch if MIT (if not simply fill YIT) : 7th
Registration date : 2006-10-22

PIC Microcontroller Empty
PostSubject: Re: PIC Microcontroller   PIC Microcontroller Icon_minitimeFri Sep 05, 2008 12:53 pm

Hi Bro,

Could you share how to initialize the Toshiba T6963C Graphic LCD Driver?

Regards,
Back to top Go down
Sponsored content





PIC Microcontroller Empty
PostSubject: Re: PIC Microcontroller   PIC Microcontroller Icon_minitime

Back to top Go down
 
PIC Microcontroller
Back to top 
Page 1 of 1
 Similar topics
-
» Migration from 8 bit to 32 bit microcontroller
» Some PIC microcontroller books...

Permissions in this forum:You cannot reply to topics in this forum
Welcome to Mandalay Technological University Forum :: Computer Software and Programming :: Microcontrollers and Embedded Programming Languages-
Jump to: