|
|
View previous topic :: View next topic |
Author |
Message |
acidice333
Joined: 14 Oct 2006 Posts: 33
|
|
Posted: Tue Nov 29, 2011 2:47 am |
|
|
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
|
|
Posted: Fri Dec 23, 2011 11:19 am |
|
|
Anybody can convert it code in RC5 for help me .... _________________ sahu |
|
|
masterat
Joined: 17 Jul 2010 Posts: 26
|
|
Posted: Tue Jan 03, 2012 1:33 am |
|
|
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
|
answer |
Posted: Mon Jan 07, 2013 10:18 pm |
|
|
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
|
Re: Infrared receiver for SONY remotes |
Posted: Sun May 12, 2013 10:33 pm |
|
|
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 |
|
|
|
|
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
|