View previous topic :: View next topic |
Author |
Message |
xwindows2000
Joined: 18 Oct 2009 Posts: 12
|
How setting configuration word for 18F4550? |
Posted: Sun Oct 18, 2009 11:59 pm |
|
|
How setting configuration word of 18F4550 for Rx and Tx by RS232? |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
|
xwindows2000
Joined: 18 Oct 2009 Posts: 12
|
How setting configuration word for 18F4550 |
Posted: Wed Oct 21, 2009 10:52 pm |
|
|
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
|
|
Posted: Wed Oct 21, 2009 11:38 pm |
|
|
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
|
How setting configuration word for 18F4550 |
Posted: Thu Oct 22, 2009 12:46 am |
|
|
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
|
|
Posted: Thu Oct 22, 2009 12:49 pm |
|
|
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
|
How setting configuration word for 18F4550? |
Posted: Thu Oct 22, 2009 6:05 pm |
|
|
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
|
|
Posted: Thu Oct 22, 2009 6:15 pm |
|
|
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
|
How setting configuration word for 18F4550? |
Posted: Thu Oct 22, 2009 6:39 pm |
|
|
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
|
Re: How setting configuration word for 18F4550? |
Posted: Sun Nov 08, 2009 6:57 am |
|
|
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
|
|
Posted: Sun Nov 08, 2009 1:47 pm |
|
|
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
|
How setting configuration word for 18F4550? |
Posted: Thu Nov 12, 2009 5:49 am |
|
|
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? |
|
|
|