C or BASIC code for PIC ... pleeeez help out!! It's urgent!

Status
Not open for further replies.

ahmad_abdulghany

Advanced Member level 4
Joined
Apr 12, 2005
Messages
1,206
Helped
102
Reputation
206
Reaction score
22
Trophy points
1,318
Location
San Jose, California, USA
Activity points
11,769
I need to write a BASIC or C code for PIC16F84A to do the followingassembly is also appreciated, I want to make it anyway!!)

1. Initialization of the value 0xf385d1ea (random 32-bit number) to a 32-bit length variable.

2. Initializing port B as follows:
-- RB0 -> interrupt (input)
-- RB1 - RB4 -> output
-- RB5 -> output

3. I want to loop for infinity on rotating the above 32-bit vector while its least significant bit go out through RB5 (i.e. RB5 varies from 1 to 0 ...etc. for infinity)

4. I want to make the time between each loop cycle variable depending on the interrupt input incrementaly, i.e. time between two cycles starts with (say) with 1ms, if an interrupt come, a counter variable (initially null valued) incremented, and in a test to it, if its value became 1, then cycle period became 0.5ms (as if frequency of output serial data varied from 1kbps to 2kbps) and so on. I have 16 different speeds, hence 16 different cycle time...

They're as follows: (followed by RB1,RB2,RB3, and RB4 corresponding output)
------------------------------------------------------------------------------------------
----bit-rate--------Time of cycle--------RB1-Rb4---
------------------------------------------------------------

----1kbps------------1000µs------------0000------

----2kbps------------500µs-------------0001------

----3kbps------------333µs-------------0010------

----4kbps------------250xµs------------0011------

----5kbps------------200µs-------------0100------

----10kbps-----------100µs-------------0101------

----15kbps-----------66µs--------------0110------

----20kbps-----------50µs--------------0111------

----25kbps-----------40µs--------------1000------

----30kbps-----------33µs--------------1001------

----40kbps------------25µs-------------1010------

----50kbps-----------20µs--------------1011------

----60kbps-----------17µs--------------1100------

----70kbps------------15µs-------------1101------

----80kbps-----------12.5µs------------1110------

----100kbps----------10µs--------------1111------

-------------------------------------------------------------

Can anyone help me please!
I really need it very urgent, I don't know how to use C or BASIC, and i don't have time to learn them now!

So please help me out !!!
Thanks,

Ahmad,
 

Re: C or BASIC code for PIC ... pleeeez help out!! It's urge

I wonder, why doesn't anyone repy yet?
Isn't the question clear?
Please if so, tell me to clarify, I need a reply very soon!!!

Thanks in advance
Ahmad,
 

Re: C or BASIC code for PIC ... pleeeez help out!! It's urge

hi Ahmed
i dont know much about PIC. but ur requist seem so big.
1st, decide which language u will use ( c, basic or assembly).

2nd, devide ur requirements into small parts
3rd, start to write the first part and ask for help if it is deffecult
when finish the first part go to next... and so on

no one will do the job u suppose to do, people just help u, u get me
good luck
Ahmed
www.i-g.org
 

Re: C or BASIC code for PIC ... pleeeez help out!! It's urge

Yes, Thanks Ahmad,

I got you, and I will try to start to write the ASM code of the program, and post problems here (i hope there's no problems)

And, still, if anyone have any idea or suggestion about it, so please do add it,

Thanks alot,
Ahmad,
 

Re: C or BASIC code for PIC ... pleeeez help out!! It's urge

Normally assembly is preffered for more control but it gets comlicated and cumbersome. C is handy but the compromise on control is there.
 

Re: C or BASIC code for PIC ... pleeeez help out!! It's urge

Hi Ahmed
I can help you wuth pleasure
youu should have a C compiler for PIC. If you don't have, I can post you one on your email.
The task is very easy in C
So disaterous in assembly

Thanks
BR
Haytham Ashour
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…