 |
 |
| View previous topic :: View next topic |
| Author |
Message |
Mike Walne
Joined: 19 Feb 2004 Posts: 1785 Location: Boston Spa UK
|
|
Posted: Tue Apr 02, 2013 4:23 pm |
|
|
No Iyed.
I'm with asmboy on this one.
You're not being consistent.
In one sentence you're asking for a free hand out.
In another you're asking for a clearer explanation.
Driving the CCS compiler is a bit like driving a motor car.
You're expected to know how to start the engine, operate lights, steering, throttle etc.
You don't have to know how the electronic ignition works, or understand the fluid dynamics of the fuel injection system.
In a similar way no one here is going to provide you with code.
You're expected to do that for yourself.
You don't need to know details of how the compiler converts from 'C' to assembler.
Your attitude is only going to alienate you from the guys on this forum who usually help.
You can now count me out.
Mike |
|
 |
temtronic
Joined: 01 Jul 2010 Posts: 9658 Location: Greensville,Ontario
|
|
Posted: Tue Apr 02, 2013 5:14 pm |
|
|
One reason why a CCS C driver hasn't been created could be the lack of interest in that device,at least in this PIC community.If I purchase those modules for about $10, I have to spend a couple nights cutting the driver code.OK, I'll 'reverse engineer' and 'cross code', but in the end it's still time out of my life.For $30, I can buy a very high quality product with better specs and works right out of the box! No hassles,no muss, no fuss..just cut 'main.c' and go.
To carry on with Mike's car analogy, some guys drive stickshift, others automatics.To get the best performance out of the car, you have to drive a stick.Same holds true for PICs, the more you dive into the 'mechanics' of PICs,the better the programmer you'll be.
I've spent 2/3s of my 60 years in 'microcomputers' and flipflopped between a 1/2 dozen or more processors.The past 20 years have been dedicated to PICs with 15+yrs using CCS C.I'm getting too old to learn any more micros or languages.
There is a great wealth of knowledge on this forum,some make a real living cutting code, others like me,'retired',now having 'fun'getting silicon to do our bidding.
Please, don't expect the regulars to cut the driver for you,the professionals need to spend their time making profit for their companies while retirees like me find it easier to buy a 'pro quality solution'
All of us are willing to look at your code,offer suggestions for better logic,flow,timing issues,syntax,etc.
As this is just a hobby to you, then choose what works best for you.
hth
jay
++++++++++++++++++++++++++
Mike Walne & temtronic,
Please stop multipage chastisement threads.
The OP wants code. You don't have code.
He doesn't get code. End of story. Post
sinks down off page.
But no, Mike & Jay & asmboy tag team must
do mind numbing chastisement of OP.
Enough!
- Forum Moderator
++++++++++++++++++++++++++ |
|
 |
Iyed
Joined: 27 Mar 2013 Posts: 9
|
|
Posted: Wed Apr 03, 2013 10:23 am |
|
|
| Hi everyone so i started tryiing to convert the virtual wire from arduino programming language to ccs as did jay say thanks by the way ;) i guess i will post after i 'll be done |
|
 |
dezso
Joined: 04 Mar 2010 Posts: 102
|
|
 |
Iyed
Joined: 27 Mar 2013 Posts: 9
|
|
Posted: Sun Apr 07, 2013 8:43 am |
|
|
Hi every body i tried to understand few things about this modules and i got a little bit to the bottom of it i wrote two examples and here's my work if there's any thing i should modify let me know please
THE EMMITER
| Code: |
#include <16F84A.h>
#FUSES NOWDT //No Watch Dog Timer
#FUSES XT //Crystal osc <= 4mhz for PCM/PCH , 3mhz to 10 mhz for PCD
#FUSES NOPUT //No Power Up Timer
#FUSES NOPROTECT //Code not protected from reading
#use delay(clock=4000000)
#use rs232(baud=1200,parity=N,xmit=PIN_A3,rcv=PIN_A2,stream =rfmodule,bits=8)
unsigned char msg;
void send_data(unsigned char data)
{
putc('J',rfmodule); // J for JUNK
delay_ms(2);
putc(0x00,rfmodule); // start transmission
delay_ms(2);
putc(0x00,rfmodule);
delay_ms(2);
putc(data,,rfmodule);
delay_ms(2);
putc(~data,rfmodule);
delay_ms(2);
putc('Z',rfmodule); // end transmission
delay_ms(102);
}
void main()
{
msg = 0x01
while (true)
{
msg ++ ;
send_data(msg);
delay_ms(1000);
}
}
|
THE RECEIVER
| Code: |
#include <16F84A.h>
#FUSES NOWDT //No Watch Dog Timer
#FUSES XT //Crystal osc <= 4mhz for PCM/PCH , 3mhz to 10 mhz for PCD
#FUSES NOPUT //No Power Up Timer
#FUSES NOPROTECT //Code not protected from reading
#use delay(clock=4000000)
#use rs232(baud=1200,parity=N,xmit=PIN_A3,rcv=PIN_A2,stream = rfmodule,bits=8)
unsigned char msg;
unsigned char get_data()
{
unsigned char data ,invdata;
int1 error = 0; //error checks if the data is received if not it will restart the while loop
do
{
if (error == 0)
{
while(!kbhit(rfmodule));
if (getc()==0x00)
continue;
else
error = 1;
}
if (error == 0)
{
while(!kbhit(rfmodule));
if (getc()==0x00)
continue;
else
error = 1;
}
if (error == 0)
{
while(!kbhit(rfmodule));
data = getc();
while(!kbhit(rfmodule));
invdata = getc();
if(data == ~invdata && error == 1)
continue;
else error = 1;
}
if (error == 0){
while(!kbhit(rfmodule));
if (getc()=='Z')
continue;
else error = 1;
}
}while (error == 1);
return data;
}
void main()
{
while (true)
{
msg = get_data();
}
}
| [/code] |
|
 |
|
|
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
|