CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

How setting configuration word for 18F4550?

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
xwindows2000



Joined: 18 Oct 2009
Posts: 12

View user's profile Send private message

How setting configuration word for 18F4550?
PostPosted: Sun Oct 18, 2009 11:59 pm     Reply with quote

How setting configuration word of 18F4550 for Rx and Tx by RS232?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Oct 19, 2009 11:17 am     Reply with quote

See this post for a simple "Hello world" program:
http://www.ccsinfo.com/forum/viewtopic.php?t=25737&start=2
xwindows2000



Joined: 18 Oct 2009
Posts: 12

View user's profile Send private message

How setting configuration word for 18F4550
PostPosted: Wed Oct 21, 2009 10:52 pm     Reply with quote

PCM programmer wrote:
See this post for a simple "Hello world" program:
http://www.ccsinfo.com/forum/viewtopic.php?t=25737&start=2


I can't send command active output pin_B0...B7
How to procedure active output pin_B0...B7 by hyperterminal
Please help me.


Last edited by xwindows2000 on Fri Oct 23, 2009 9:12 am; edited 1 time in total
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Oct 21, 2009 11:38 pm     Reply with quote

Quote:
void main(void)
{
set_tris_b(0x00); //set port B output
output_b(0x00); //clear port B
setup_adc(adc_off);
enable_interrupts(GLOBAL);
enable_interrupts(INT_RDA); // RS232 receive data eable interrupts
enable_interrupts(INT_TBE); // RS232 transmit data eable interrupts

while (true); // loop nothing

}

Don't enable TBE interrupts. You don't need them. Also, don't enable
an interrupt when you don't have an interrupt service routine for it.
This will cause the program to crash. Delete the line shown in bold.
xwindows2000



Joined: 18 Oct 2009
Posts: 12

View user's profile Send private message

How setting configuration word for 18F4550
PostPosted: Thu Oct 22, 2009 12:46 am     Reply with quote

PCM programmer wrote:
Quote:
void main(void)
{
set_tris_b(0x00); //set port B output
output_b(0x00); //clear port B
setup_adc(adc_off);
enable_interrupts(GLOBAL);
enable_interrupts(INT_RDA); // RS232 receive data eable interrupts
enable_interrupts(INT_TBE); // RS232 transmit data eable interrupts

while (true); // loop nothing

}

Don't enable TBE interrupts. You don't need them. Also, don't enable
an interrupt when you don't have an interrupt service routine for it.
This will cause the program to crash. Delete the line shown in bold.


Thank you
I will delete "enable_interrupts(INT_TBE)" but I can't send command active output port B.

How to procedure force output pin_B0...B7 by serial interface.
I type 0,1,2,3......9 in hyperterminal why output pin B0...B7 not active.
Please help me.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Oct 22, 2009 12:49 pm     Reply with quote

I tested your code (after removing the line for INT_TBE) with vs. 4.099
on a PicDem2-Plus board. It works.

What is your compiler version ?
xwindows2000



Joined: 18 Oct 2009
Posts: 12

View user's profile Send private message

How setting configuration word for 18F4550?
PostPosted: Thu Oct 22, 2009 6:05 pm     Reply with quote

PCM programmer wrote:
I tested your code (after removing the line for INT_TBE) with vs. 4.099
on a PicDem2-Plus board. It works.

What is your compiler version ?


My CCS compiler version 4.057.
Can you shown configuration bits 300000h...3FFFFFh and your photo test procedure.

Thank
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Oct 22, 2009 6:15 pm     Reply with quote

I installed vs. 4.057. It works.

Here are the Config bits for vs. 4.057 (from the .LST file):
Code:

Configuration Fuses:
   Word  1: 0C20   NOIESO NOFCMEN HS PLL1 CPUDIV1 USBDIV
   Word  2: 1E1E   BROWNOUT NOWDT BORV20 PUT WDT32768 NOVREGEN RESERVED
   Word  3: 8300   PBADEN CCP2C1 MCLR NOLPT1OSC RESERVED
   Word  4: 0081   STVREN NODEBUG NOLVP NOXINST NOICPRT RESERVED
   Word  5: C00F   NOPROTECT NOCPD NOCPB
   Word  6: E00F   NOWRT NOWRTD NOWRTC NOWRTB
   Word  7: 400F   NOEBTR NOEBTRB


Test procedure:
1. Connect a serial cable between my PC and the PicDem2-Plus board.
2. Start-up TeraTerm. Instruction for installing TeraTerm:
http://www.ccsinfo.com/forum/viewtopic.php?t=39388&start=18
3. Type '1' several times. Watch RB1 LED blink on and off.
4. Type '2' several times. Watch RB2 LED blink on and off.
5. Type '3' several times. Watch RB3 LED blink on and off.
xwindows2000



Joined: 18 Oct 2009
Posts: 12

View user's profile Send private message

How setting configuration word for 18F4550?
PostPosted: Thu Oct 22, 2009 6:39 pm     Reply with quote

PCM programmer wrote:
I installed vs. 4.057. It works.

Here are the Config bits for vs. 4.057 (from the .LST file):
Code:

Configuration Fuses:
   Word  1: 0C20   NOIESO NOFCMEN HS PLL1 CPUDIV1 USBDIV
   Word  2: 1E1E   BROWNOUT NOWDT BORV20 PUT WDT32768 NOVREGEN RESERVED
   Word  3: 8300   PBADEN CCP2C1 MCLR NOLPT1OSC RESERVED
   Word  4: 0081   STVREN NODEBUG NOLVP NOXINST NOICPRT RESERVED
   Word  5: C00F   NOPROTECT NOCPD NOCPB
   Word  6: E00F   NOWRT NOWRTD NOWRTC NOWRTB
   Word  7: 400F   NOEBTR NOEBTRB


Test procedure:
1. Connect a serial cable between my PC and the PicDem2-Plus board.
2. Start-up TeraTerm. Instruction for installing TeraTerm:
http://www.ccsinfo.com/forum/viewtopic.php?t=39388&start=18
3. Type '1' several times. Watch RB1 LED blink on and off.
4. Type '2' several times. Watch RB2 LED blink on and off.
5. Type '3' several times. Watch RB3 LED blink on and off.


Thank, I'll work again.
if I have problem I will ask you again.

Thank you.
xwindows2000



Joined: 18 Oct 2009
Posts: 12

View user's profile Send private message

Re: How setting configuration word for 18F4550?
PostPosted: Sun Nov 08, 2009 6:57 am     Reply with quote

xwindows2000 wrote:
PCM programmer wrote:
I installed vs. 4.057. It works.

Here are the Config bits for vs. 4.057 (from the .LST file):
Code:

Configuration Fuses:
   Word  1: 0C20   NOIESO NOFCMEN HS PLL1 CPUDIV1 USBDIV
   Word  2: 1E1E   BROWNOUT NOWDT BORV20 PUT WDT32768 NOVREGEN RESERVED
   Word  3: 8300   PBADEN CCP2C1 MCLR NOLPT1OSC RESERVED
   Word  4: 0081   STVREN NODEBUG NOLVP NOXINST NOICPRT RESERVED
   Word  5: C00F   NOPROTECT NOCPD NOCPB
   Word  6: E00F   NOWRT NOWRTD NOWRTC NOWRTB
   Word  7: 400F   NOEBTR NOEBTRB


Test procedure:
1. Connect a serial cable between my PC and the PicDem2-Plus board.
2. Start-up TeraTerm. Instruction for installing TeraTerm:
http://www.ccsinfo.com/forum/viewtopic.php?t=39388&start=18
3. Type '1' several times. Watch RB1 LED blink on and off.
4. Type '2' several times. Watch RB2 LED blink on and off.
5. Type '3' several times. Watch RB3 LED blink on and off.


Thank, I'll work again.
if I have problem I will ask you again.

Thank you.


Hi PCM,
In case any bit active high. How to reading active status or How to MCU send active status to visual C#.

pls help me.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sun Nov 08, 2009 1:47 pm     Reply with quote

You don't have to quote the whole previous post every time you make
a post. It makes it difficult to follow the thread.
xwindows2000



Joined: 18 Oct 2009
Posts: 12

View user's profile Send private message

How setting configuration word for 18F4550?
PostPosted: Thu Nov 12, 2009 5:49 am     Reply with quote

PCM programmer wrote:
You don't have to quote the whole previous post every time you make
a post. It makes it difficult to follow the thread.


Why? Why? Why? Why?
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group