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

Making USB And Serial Work Together [solved]

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



Joined: 24 Apr 2010
Posts: 10

View user's profile Send private message Visit poster's website

Making USB And Serial Work Together [solved]
PostPosted: Sun May 16, 2010 11:03 am     Reply with quote

Hello. I have a PIC 18F2550 running with a 20MHz crystal and the following configuration.

Code:
#include <18F2550.h>
#device adc=8

#FUSES NOWDT                    //No Watch Dog Timer
#FUSES WDT128                   //Watch Dog Timer uses 1:128 Postscale
#FUSES HSPLL                    //Internal RC Osc INTRC
#FUSES NOPROTECT                //Code not protected from reading
#FUSES BROWNOUT               //No brownout reset NOBROWNOUT
#FUSES BORV20                   //Brownout reset at 2.0V
#FUSES PUT                    //No Power Up Timer NOPUT
#FUSES NOCPD                    //No EE protection
#FUSES STVREN                   //Stack full/underflow will cause reset
#FUSES NODEBUG                  //No Debug mode for ICD
#FUSES NOLVP                    //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O
#FUSES NOWRT                    //Program memory not write protected
#FUSES NOWRTD                   //Data EEPROM not write protected
#FUSES IESO                     //Internal External Switch Over mode enabled
#FUSES FCMEN                    //Fail-safe clock monitor enabled
#FUSES PBADEN                   //PORTB pins are configured as analog input channels on RESET
#FUSES NOWRTC                   //configuration not registers write protected
#FUSES NOWRTB                   //Boot block not write protected
#FUSES NOEBTR                   //Memory not protected from table reads
#FUSES NOEBTRB                  //Boot block not protected from table reads
#FUSES NOCPB                    //No Boot Block code protection
#FUSES MCLR                     //Master Clear pin enabled
#FUSES LPT1OSC                  //Timer1 configured for low-power operation
#FUSES NOXINST                  //Extended set extension and Indexed Addressing mode disabled (Legacy mode) NOXINST
#FUSES PLL5                    //Divide By 12(48MHz oscillator input) PLL12
#FUSES CPUDIV1                  //System Clock by 4 CPUDIV4
#FUSES USBDIV                   //USB clock source comes from PLL divide by 2
#FUSES VREGEN                   //USB voltage regulator enabled

#use delay(clock=48000000)


Now, I need to read information from a serial RFID reader. It works at 2400 bps.

I have the following configuration for the serial communication, but it is reading garbage.

Code:
#use rs232(baud=2400, rcv=PIN_A0, ENABLE=PIN_A1, stream=RFID, PARITY=N, bits=8)


I have also tried with other baud values, like 12000, 480, 4800, 1200, 6000 and 960. But nothing works.


Last edited by kiewic on Sun May 16, 2010 7:24 pm; edited 1 time in total
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sun May 16, 2010 11:48 am     Reply with quote

Post a link to the complete data sheet for the RFID reader.
kiewic



Joined: 24 Apr 2010
Posts: 10

View user's profile Send private message Visit poster's website

Oops!
PostPosted: Sun May 16, 2010 7:24 pm     Reply with quote

Hey, thanks for your interest. It was a power problem.
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