[SOLVED] PIC complete discussion for all

Status
Not open for further replies.
Well, the hardware not an issue here, just the time.

I got three systems in my office, Quad Core i7 2.8GHz and two Dual 3.6GHz XEON x64 systems, all three have 8GB of RAM.

And that's the small stuff, in the lab I've got some Big Iron.
 
Thanks again about the tutorial you have posted.. I will surely read and follow it and post here the result..



Well, the hardware not an issue here, just the time.

I got three systems in my office, Quad Core i7 2.8GHz and two Dual 3.6GHz XEON x64 systems, all three have 8GB of RAM.

And that's the small stuff, in the lab I've got some Big Iron.

wow pretty awesome systems . I have only here for personal use core i3 530 with 4Gb of RAM..
 

You should give Assembly a try, the PIC 16F series only has 35 instructions all are single word. The beauty of a RISC processor is it's simplicity.

If you pickup a 16F877A, grab a 12F629 or 12F675, there less than a $1 USD a piece. And then take that Gooligum Midrange PIC Assembler Tutorial.
You'll have no problems learning the PIC Assembler.

Besides, once you understand an architecture's assembly code, coding for that particular device in C is becomes second nature. An added benefit is the abundance of assembly routines available. You can incorporate these assembly routines as modules in C programs.

Give it a try, you won't regret it.

Ciao
 
You should give Assembly a try, the PIC 16F series only has 35 instructions all are single word. The beauty of a RISC processor is it's simplicity.

yes if I get time to review my assembly Im afraid of assembly... but i will try..

by the way 12F629 is 8kb of program memory space. right? when we say program memory that is where our code instruction reside?
 

by the way 12F629 is 8kb of program memory space. right?

The midrange tutorials use a 12F629, but the 12F675 is virtually the same, but with 4-channel of ADC, a little more versatile. They are both only 8-pin MCUs and have only 1k words of program memory. The Microchip's use of the terms "byte" and "word" can be somewhat confusing. The PIC 12F series has a 14-bit instruction word, so referring to the program memory in terms of "bytes" can be misleading. However, referencing the program memory size in terms of "words" give you a clearer idea of a particular PIC's storage capacity in relation to program size.

when we say program memory that is where our code instruction reside?

Correct, the program memory is actually flash memory.

The RAM is where variables declared in the C program would be stored, provides for ease of changing a variables contents in the program.

And then there is EEPROM, which is nonvolatile storage for persistent data and can be modified as well during runtime.
 
They are both only 8-pin MCUs and have only 1k words of program memory.

let's try my conversion skill 1K words is equal to 2kb of program memory I think.
if Im correct maybe I understand..
 

let's try my conversion skill 1K words is equal to 2kb of program memory I think.
if Im correct maybe I understand..

Close, the Microchip lists the PIC12F629/675 program memory as 1.75KB, now you understand on what these unusual memory size are based.

I happened upon the following site with C programs specifically for the PIC16F628A, a slighty newer version of your MCU:



I believe they are written for an open source C compiler, you still maybe able to glean some tips or ideas from the code.

Hope your C projects are progressing along smoother.

Ciao
 
actually, I just use this chip (PIC16F628A) for learning purposes.. this is my first time with PIC micro...

-->> thank for this..

---------- Post added at 01:15 ---------- Previous post was at 00:40 ----------

by the way. what PIC has a built in EEPROM like 24CXX ?

I read the datasheet of PIC16f628 and found this..


**broken link removed**
 

-------------------------------------
1>Why I can't use GIE=0; inside ISR? (high tech c)
-------------------------------------
2>In TIMER0 interrupt, if i use T0IE=1;
then it is enabled.
There after I disable it (T0IE=0
Then it is not enabling if i use T0IE=1;
Why it is like this ?

example
-------
T0IE=1;
T0IE=0;
T0IE=1;

if i use above code, then timer0 interrupt is not enabling!

So, if ones enabled and then disabled, there after, i couldn't enable in again!
------------------------------------
 

2>In TIMER0 interrupt, if i use T0IE=1;
then it is enabled.
There after I disable it (T0IE=0
Then it is not enabling if i use T0IE=1;
Why it is like this ?

how can you say that it is not enabling? did you check the T0IF?
T0IE=1; is just for enabling the interrupt of timer0 and that will not enable/disable the TIMER0

you can still use timer 0 for a delay without using interrupt bit...


hehe I hope what i am saying here is correct..
. hehe :grin:
 

hi.. im learning SPI protocol for pIC today.. I do reading about SPI this time..

---------- Post added at 14:35 ---------- Previous post was at 14:30 ----------

Im using PIC18f4550.. let me ask question again if I have question.. I just want o learn the SPI protocol..
 

thanks ckshivaram,

how do I read the output of SPI? let say I want to output any data from SPI?

I think there is LCD that supports SPI interface.. right?
 

For testing, you can short the 'data out' and 'data in' of spi and then send any character. Then you will receive the same one.... Then you can send it to a PC via UART to verify it, or you can program your PIC in such a way that if received data is same as that of send data,then LED glows ..etc etc..
 

thanks,, that's a great practical advice.. Im also thinking that way but first Im learning how SPI works before I can make a code for SPI interfacing ..

---------- Post added at 15:49 ---------- Previous post was at 15:31 ----------

i jUst read we can still use SPI protocol without a SPI hardware module using software SPI..
 

Yes it is also possible.. We can send data 'bit' by 'bit' followed by a 'clock' through any two GPIO pins by programming it accordingly .......But it may not be efficient like a hardware SPI.
 
Yes it is also possible.. We can send data 'bit' by 'bit' followed by a 'clock' through any two GPIO pins by programming it accordingly .......But it may not be efficient like a hardware SPI.

yes. I know that.. I also did the same with software PWM.. hardware module PWM is much better.. :thumbs up:

I'm also finding more detail tutorial about SPI.. before I do some interfacing or any application involving SPI I need to learn first SPI in the first place..
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…