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

Infrared receiver for SONY remotes
Goto page Previous  1, 2
 
Post new topic   Reply to topic    CCS Forum Index -> Code Library
View previous topic :: View next topic  
Author Message
acidice333



Joined: 14 Oct 2006
Posts: 33

View user's profile Send private message

PostPosted: Tue Nov 29, 2011 2:47 am     Reply with quote

Just curious how do you calculate for 48mhz? its probably right in front of me and I just dont understand. Much appreciated thanks!

Quote:

/* TIMER0 configuration */
#define TIMER0_CONFIG RTCC_INTERNAL | RTCC_DIV_1

/* Interrupt rate: */
/* 4/32000000*65536*1 = 8.192 ms */
/* */
/* Start: 3.0 ms (ignored) */
/* "1": 1.8 ms (14400) */
/* "0": 1.2 ms (9600) */

#define ONE_MIN 13400
#define ONE_MAX 15400
#define ZERO_MIN 8600
#define ZERO_MAX 10600

sahu77



Joined: 08 Sep 2011
Posts: 202

View user's profile Send private message

PostPosted: Fri Dec 23, 2011 11:19 am     Reply with quote

Anybody can convert it code in RC5 for help me ....
_________________
sahu
masterat



Joined: 17 Jul 2010
Posts: 26

View user's profile Send private message

PostPosted: Tue Jan 03, 2012 1:33 am     Reply with quote

acidice333 wrote:
Just curious how do you calculate for 48mhz? its probably right in front of me and I just dont understand. Much appreciated thanks!

/* TIMER0 configuration */
#define TIMER0_CONFIG RTCC_INTERNAL | RTCC_DIV_1

/* Interrupt rate: */
/* 4/32000000*65536*1 = 8.192 ms */
/* */
/* Start: 3.0 ms (ignored) */
/* "1": 1.8 ms (14400) */
/* "0": 1.2 ms (9600) */

#define ONE_MIN 13400
#define ONE_MAX 15400
#define ZERO_MIN 8600
#define ZERO_MAX 10600

48 Mhz Should be:
Code:

/* Interrupt rate:                     */
/* 4/48000000*65536*1 = 5.46125 ms       */
/*                                     */
/*     Start: 3.0 ms (ignored)         */
/*     "1":   1.8 ms (21600)           */
/*     "0":   1.2 ms  (14400)           */

#define ONE_MIN  22600
#define ONE_MAX  20600
#define ZERO_MIN 13400
#define ZERO_MAX 15400
rdoradus



Joined: 07 Jan 2013
Posts: 1

View user's profile Send private message

answer
PostPosted: Mon Jan 07, 2013 10:18 pm     Reply with quote

The answer for HTAluvBeBeo is only work with #fuses. I compile the code for send with RS-232 and proved with pickit2 clone and it works great

I have written next fuses in header:

Code:
#include <18f4550.h>
#FUSES HS,NOWDT,WDT128,NOPROTECT,NOBROWNOUT,BORV20,PUT,MCLR,NOCPD,NODEBUG,NOLVP,NOWRT,NOWRTD,NOWRTB,NOEBTR,NOEBTRB,NOCPB,NOWRTC,NOFCMEN,NOPBADEN,PLL1,CPUDIV1,USBDIV,VREGEN,ICPRT,STVREN,NOIESO,LPT1OSC,NOXINST               

#use delay(clock=20000000)
#use rs232(baud=9600, xmit=PIN_B7, rcv=PIN_B6)

#use fast_io(B)

/* TIMER0 configuration */
#define TIMER0_CONFIG   RTCC_INTERNAL | RTCC_DIV_1

/* Interrupt rate:                     */
/* 4/20000000*65536*1 = 13.1072 ms    5.46125   */
/*                                     */
/*     Start: 3.0 ms (ignored)         */
/*     "1":   1.8 ms (9000)          7.28177777 */
/*     "0":   1.2 ms  (6000)          10.922666 */

#define ONE_MIN 8000
#define ONE_MAX 10000
#define ZERO_MIN 5000
#define ZERO_MAX 7000


All extra code equal...

Crystal of 20MHz PIC18F2550 and RS-232 from Pickit2 clone.
loctip



Joined: 12 May 2013
Posts: 1

View user's profile Send private message Send e-mail

Re: Infrared receiver for SONY remotes
PostPosted: Sun May 12, 2013 10:33 pm     Reply with quote

Code:
/* Interrupt rate:                     */
/* 4/32000000*65536*1 = 8.192 ms       */
/*                                     */
/*     Start: 3.0 ms (ignored)         */
/*     "1":   1.8 ms (14400)           */
/*     "0":   1.2 ms  (9600)           */
 

Plz show me how to calculate these datas !
Thanks a lot
14400 9600
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> Code Library All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
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