caramoan tour package

caramoan tour package

Author Topic: Q&A sa CCS C  (Read 7219 times)

Offline clarkent

  • Lead Acid Battery
  • *******
  • Posts: 505
  • Pogi/Ganda Points: 20
  • Gender: Male
  • iehs
Re: Q&A sa CCS C
« Reply #60 on: March 04, 2009, 03:44:11 PM »
hmmm.... bakit kaya di gumagana sakin. natry mo mismo sa proteus sir? pagnagkkey-in ka ng a b c tlgang umiilaw yung corresponding led?
if you think you can or think you can't, you're probably right -h.ford

Philippine Electronics Forum

Re: Q&A sa CCS C
« Reply #60 on: March 04, 2009, 03:44:11 PM »

Offline marcelino

  • Moderator
  • Solar Power Satellite
  • *****
  • Posts: 6016
  • Pogi/Ganda Points: 258
  • ...keep moving forward! - Robinson's
Re: Q&A sa CCS C
« Reply #61 on: March 04, 2009, 03:51:48 PM »
hmmm.... bakit kaya di gumagana sakin. natry mo mismo sa proteus sir? pagnagkkey-in ka ng a b c tlgang umiilaw yung corresponding led?

yeah! :)
"Don't take life seriously. After all, no one has ever come out of it alive. -Bugs Bunny"

Philippine Electronics Forum

Re: Q&A sa CCS C
« Reply #61 on: March 04, 2009, 03:51:48 PM »

Offline clarkent

  • Lead Acid Battery
  • *******
  • Posts: 505
  • Pogi/Ganda Points: 20
  • Gender: Male
  • iehs
Re: Q&A sa CCS C
« Reply #62 on: March 06, 2009, 11:09:45 AM »
gumagana na!!!hehe
nalagyan ko pala kasi sa void main(){ ng set_tris_b(0); kaya di gumagana.hehe
if you think you can or think you can't, you're probably right -h.ford

Philippine Electronics Forum

Re: Q&A sa CCS C
« Reply #62 on: March 06, 2009, 11:09:45 AM »

Offline marcelino

  • Moderator
  • Solar Power Satellite
  • *****
  • Posts: 6016
  • Pogi/Ganda Points: 258
  • ...keep moving forward! - Robinson's
Re: Q&A sa CCS C
« Reply #63 on: March 06, 2009, 11:30:32 AM »
gumagana na!!!hehe
nalagyan ko pala kasi sa void main(){ ng set_tris_b(0); kaya di gumagana.hehe

may naobserbahan ako sa CCS.

di ba sa hitech, palagi nating siniset ang tris at initial values ng port.

sa CCS, kung wala ka lang naman exquisite na gagawin, wag mo nang lalagyan ng set_tris_x().  ang compiler na ang bahala nyan!
"Don't take life seriously. After all, no one has ever come out of it alive. -Bugs Bunny"

Philippine Electronics Forum

Re: Q&A sa CCS C
« Reply #63 on: March 06, 2009, 11:30:32 AM »

Offline clarkent

  • Lead Acid Battery
  • *******
  • Posts: 505
  • Pogi/Ganda Points: 20
  • Gender: Male
  • iehs
Re: Q&A sa CCS C
« Reply #64 on: March 07, 2009, 09:26:54 AM »
ganun ba sir kahit na gagamitin mong input ang ibang pins? say RA4 as input. hindi na natin lalagyan nito

set_tris_a(0b00010000);
if you think you can or think you can't, you're probably right -h.ford

Philippine Electronics Forum

Re: Q&A sa CCS C
« Reply #64 on: March 07, 2009, 09:26:54 AM »

Offline marcelino

  • Moderator
  • Solar Power Satellite
  • *****
  • Posts: 6016
  • Pogi/Ganda Points: 258
  • ...keep moving forward! - Robinson's
Re: Q&A sa CCS C
« Reply #65 on: March 07, 2009, 10:04:55 AM »
ganun ba sir kahit na gagamitin mong input ang ibang pins? say RA4 as input. hindi na natin lalagyan nito

set_tris_a(0b00010000);

yeah!

ano yung code mo?
"Don't take life seriously. After all, no one has ever come out of it alive. -Bugs Bunny"

Offline clarkent

  • Lead Acid Battery
  • *******
  • Posts: 505
  • Pogi/Ganda Points: 20
  • Gender: Male
  • iehs
Re: Q&A sa CCS C
« Reply #66 on: March 07, 2009, 10:07:01 AM »
wala pa naman sir. naisip ko lang na what if gahamit ako ng input, syempre dapat ispecify sa code.hehe
if you think you can or think you can't, you're probably right -h.ford

Offline marcelino

  • Moderator
  • Solar Power Satellite
  • *****
  • Posts: 6016
  • Pogi/Ganda Points: 258
  • ...keep moving forward! - Robinson's
Re: Q&A sa CCS C
« Reply #67 on: March 07, 2009, 10:09:44 AM »
wala pa naman sir. naisip ko lang na what if gahamit ako ng input, syempre dapat ispecify sa code.hehe

basta ang CCS na ang bahala nyan...

ang di ko lang alam kung ano yung ginawa ng CCS dun sa settings ng pins na yun.... pwede siguro tong itrace sa .LST. kaso di ako magaling sa assembly.

pero kahit nga mahahaba na ang ginagawa ko, di pa ako gumamit nyan. ang nagwowork naman.
"Don't take life seriously. After all, no one has ever come out of it alive. -Bugs Bunny"

Offline clarkent

  • Lead Acid Battery
  • *******
  • Posts: 505
  • Pogi/Ganda Points: 20
  • Gender: Male
  • iehs
Re: Q&A sa CCS C
« Reply #68 on: March 07, 2009, 10:25:13 AM »
hehe... the last time kasi na nagtry ako ng uart using f628a at nagconnect ako ng leds sa porta, hindi yun umilaw, pero nung nilagay ko yung set_tris_a(0); gumana na sya.
if you think you can or think you can't, you're probably right -h.ford

Offline clarkent

  • Lead Acid Battery
  • *******
  • Posts: 505
  • Pogi/Ganda Points: 20
  • Gender: Male
  • iehs
Re: Q&A sa CCS C
« Reply #69 on: March 08, 2009, 07:46:20 PM »
papano po gamitin ang #int_rda ng CCSC?

pwede pong papost ng sample codes?
if you think you can or think you can't, you're probably right -h.ford

Offline marcelino

  • Moderator
  • Solar Power Satellite
  • *****
  • Posts: 6016
  • Pogi/Ganda Points: 258
  • ...keep moving forward! - Robinson's
Re: Q&A sa CCS C
« Reply #70 on: March 08, 2009, 07:55:53 PM »
papano po gamitin ang #int_rda ng CCSC?

pwede pong papost ng sample codes?

Code: [Select]
char c;
short rda_flag;

#int_RDA
void RDA_isr (void)
{
c=getc();
rda_flag = TRUE;
}

main(void)
{
enable_interrupts(int_RDA);
enable_interrupts(GLOBAL);
while(true)
{
if (rda_flag)
{
disable_interrupt(int_RDA);
rda_flag = TRUE;
if (c=='M')
{
printf("marcelino pogi\r");
}
}
}
}
"Don't take life seriously. After all, no one has ever come out of it alive. -Bugs Bunny"

Offline clarkent

  • Lead Acid Battery
  • *******
  • Posts: 505
  • Pogi/Ganda Points: 20
  • Gender: Male
  • iehs
Re: Q&A sa CCS C
« Reply #71 on: March 08, 2009, 08:03:19 PM »
isa pang tanong sir marce, how will the int_rda be triggered? pwede ba tong matrigger using an input pin of an MCU. kunwari may pinindot kang push button tapos mattrigger na ang int RDA.
if you think you can or think you can't, you're probably right -h.ford

Offline marcelino

  • Moderator
  • Solar Power Satellite
  • *****
  • Posts: 6016
  • Pogi/Ganda Points: 258
  • ...keep moving forward! - Robinson's
Re: Q&A sa CCS C
« Reply #72 on: March 08, 2009, 08:40:27 PM »
isa pang tanong sir marce, how will the int_rda be triggered? pwede ba tong matrigger using an input pin of an MCU. kunwari may pinindot kang push button tapos mattrigger na ang int RDA.

hindi...

ayon sa natutunan ko kay master Zerowing, natitirigger ang RDA kapag may may pumasok na signal (ascii character). rda stands for received data available. kaya nga may nilagay akong flag (rda_flag) nakung saan nagiging TRUE lamang kapag may RDA.

kung may pipindutin kang buttom, mas maigi na gamitin mo yung RB(4:7) o kaya yung RB0.
"Don't take life seriously. After all, no one has ever come out of it alive. -Bugs Bunny"

Offline clarkent

  • Lead Acid Battery
  • *******
  • Posts: 505
  • Pogi/Ganda Points: 20
  • Gender: Male
  • iehs
Re: Q&A sa CCS C
« Reply #73 on: March 09, 2009, 12:36:04 PM »
nyahaha! sori sir marce, mali yung pagkakaintindi ko nung receive dat available.hehe

so ang magttrigger po pala ng rda is itong keyboard mismo?



if you think you can or think you can't, you're probably right -h.ford

Offline marcelino

  • Moderator
  • Solar Power Satellite
  • *****
  • Posts: 6016
  • Pogi/Ganda Points: 258
  • ...keep moving forward! - Robinson's
Re: Q&A sa CCS C
« Reply #74 on: March 09, 2009, 01:09:03 PM »
nyahaha! sori sir marce, mali yung pagkakaintindi ko nung receive dat available.hehe

so ang magttrigger po pala ng rda is itong keyboard mismo?

di naman necessarily keyboard. aking nga, XBEE module or GSM modem. ;D

basta ba may data...

nga pala, ayon din sa natutunan ko kay master Zero, per character ang pagrereceive ng UART module ng PIC. nung una akala ko isang malaking string. bagamat nagwowork naman ang gets(), mas maiging wag mo masyadong gagamitin sa loob ng RDA_isr. kasi triggered na kaagad ang RDA routines sa kahit isang character lamang.

halimbawa, ang nareceive na data ng UART module is "pogi". apat na characters(actually lima or anim, return = 0x0D at space = 0x0A ay kadalasang kasama). ibig sabihin, apat na bese din natrigger ang RDA.

So mas maganda sa pagParsing ng receive string, gamitin mo pa din yung getc(), tapos may buffer nalang na nag-iipon nung string.
"Don't take life seriously. After all, no one has ever come out of it alive. -Bugs Bunny"

Offline clarkent

  • Lead Acid Battery
  • *******
  • Posts: 505
  • Pogi/Ganda Points: 20
  • Gender: Male
  • iehs
Re: Q&A sa CCS C
« Reply #75 on: March 16, 2009, 11:04:07 AM »
how do you test a bit from the status register using CCSC? say, gusto kong malaman kung naapektuhan ng isang operation yung DC,Z or C ng STATUS.
if you think you can or think you can't, you're probably right -h.ford

Offline marcelino

  • Moderator
  • Solar Power Satellite
  • *****
  • Posts: 6016
  • Pogi/Ganda Points: 258
  • ...keep moving forward! - Robinson's
Re: Q&A sa CCS C
« Reply #76 on: March 16, 2009, 11:50:53 AM »
try mo nga to kit...

Code: [Select]
//sa definitions
#bit Z 0x03.2
#bit DC 0x03.1
#bit C 0x03.0

tapos...

if (Z==true) output_high (pin_a0);
if (DC==true) output_high (pin_a1);
if (C==true) output_high (pin_a2);

experiment lang... :)
"Don't take life seriously. After all, no one has ever come out of it alive. -Bugs Bunny"

Offline clarkent

  • Lead Acid Battery
  • *******
  • Posts: 505
  • Pogi/Ganda Points: 20
  • Gender: Male
  • iehs
Re: Q&A sa CCS C
« Reply #77 on: March 16, 2009, 01:00:48 PM »
^ natest mo na po yan sir marce?hehe
pogi mo.
if you think you can or think you can't, you're probably right -h.ford

Offline marcelino

  • Moderator
  • Solar Power Satellite
  • *****
  • Posts: 6016
  • Pogi/Ganda Points: 258
  • ...keep moving forward! - Robinson's
Re: Q&A sa CCS C
« Reply #78 on: March 16, 2009, 01:23:08 PM »
^ natest mo na po yan sir marce?hehe
pogi mo.

di pa.... hehehe ;D
kaya nga experiment eh :D

para magawa natin yan, dapat siguruhin natin na may alam tayong operation na kung saan mag-oOn yang mga flags na yan.
"Don't take life seriously. After all, no one has ever come out of it alive. -Bugs Bunny"

Offline clarkent

  • Lead Acid Battery
  • *******
  • Posts: 505
  • Pogi/Ganda Points: 20
  • Gender: Male
  • iehs
Re: Q&A sa CCS C
« Reply #79 on: March 16, 2009, 02:02:28 PM »
nyaaaaaa!!!!
if you think you can or think you can't, you're probably right -h.ford

Philippine Electronics Forum

Re: Q&A sa CCS C
« Reply #79 on: March 16, 2009, 02:02:28 PM »

 

Privacy Policy

Contact Us: elabph@yahoo.com