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 CCS Technical Support

PIC18F1320 RX (receive) Problem

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



Joined: 13 Sep 2003
Posts: 87

View user's profile Send private message

PIC18F1320 RX (receive) Problem
PostPosted: Mon Mar 15, 2004 8:46 pm     Reply with quote

Hello.

Guys I need your help on the PIC18F1320 reception problem. I have configured my PIC at 20MHz clock using the following configuration.

Code:

#include <18F1320.h>                    // Target PIC Microcontroller IC
#device *=16                            // use a 16-bit pointer

#fuses HS,NOLVP,NOWDT,NOPROTECT,MCLR    // MCU fuse configuration
#use delay(clock=20000000)              // 20MHz clock speed

// hardware based UART for #INT_RDA and #INT_TBE (RS485 Communication)
#use rs232(baud=115200,parity=N,xmit=PIN_B1,rcv=PIN_B4, \
           bits=8,stream=RS485Com,enable=PIN_A1)


To give a complete picture, I have the steps below:
[1] I downloadded the code to PIC and execute the run command of the ICD and wait for blinking LED to lit.
[2] I send a command to the PIC and the PIC responded. --> this OK
[3] I stop the ICD and remove the programmer cable connected to the PIC such that the PIC will run without the programmer --> free ruuning.
[4] I send a command to the PIC and the PIC responded --> this OK
[5] Next I turn-off the power of the PIC system and after few seconds I turn-on the PIC system.

This the porblem....
[6] wait the blinkking LED to lit... then I send a command to the PIC and the PIC did not respond.
[7] This is the cathc... when the PIC sends data to the PC on this situation the PC received the data.

I don't know what cause this problem? can you help me on this? I really need feedback on this... I never had this problem in PIC18F452 before.

BTW, I have enable pull-ups on PortB of PIC18F1320 and use ceramic resonator from Murata 20MHz clock.

Thank you.
ritchie



Joined: 13 Sep 2003
Posts: 87

View user's profile Send private message

Re: PIC18F1320 RX (receive) Problem
PostPosted: Tue Mar 16, 2004 8:04 am     Reply with quote

ritchie wrote:
Hello.

Guys I need your help on the PIC18F1320 reception problem. I have configured my PIC at 20MHz clock using the following configuration.

Code:

#include <18F1320.h>                    // Target PIC Microcontroller IC
#device *=16                            // use a 16-bit pointer

#fuses HS,NOLVP,NOWDT,NOPROTECT,MCLR    // MCU fuse configuration
#use delay(clock=20000000)              // 20MHz clock speed

// hardware based UART for #INT_RDA and #INT_TBE (RS485 Communication)
#use rs232(baud=115200,parity=N,xmit=PIN_B1,rcv=PIN_B4, \
           bits=8,stream=RS485Com,enable=PIN_A1)


To give a complete picture, I have the steps below:
[1] I downloadded the code to PIC and execute the run command of the ICD and wait for blinking LED to lit.
[2] I send a command to the PIC and the PIC responded. --> this OK
[3] I stop the ICD and remove the programmer cable connected to the PIC such that the PIC will run without the programmer --> free ruuning.
[4] I send a command to the PIC and the PIC responded --> this OK
[5] Next I turn-off the power of the PIC system and after few seconds I turn-on the PIC system.

This the porblem....
[6] wait the blinkking LED to lit... then I send a command to the PIC and the PIC did not respond.
[7] This is the cathc... when the PIC sends data to the PC on this situation the PC received the data.

I don't know what cause this problem? can you help me on this? I really need feedback on this... I never had this problem in PIC18F452 before.

BTW, I have enable pull-ups on PortB of PIC18F1320 and use ceramic resonator from Murata 20MHz clock.

Thank you.


Hello Guys,

I have found the culprit.. actually their is nothing wrong with the UART the problem really lies in the EEPROM.

when I download my code to the PIC then run the system... it will write to an eeprom the machine address of the device... some sort of a deviceID... this deviceID is needed such that the PC can send commands to specific device with their corresponding IDs.

Unfortunately, when you power down the system and turn-on it again with the downloader cable is detach the content of the eeprom is reverted to 0000 but when you connect the downloader cable press the run button it works fine... the content of the eeprom is OK.

Do u have any idea why this so? Is this an errata to PIC18F1320? anyone who can provide me a hint?

Thank you.
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