Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

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,209
Helped
102
Reputation
206
Reaction score
21
Trophy points
1,318
Location
San Jose, California, USA
Activity points
11,781
I need to write a BASIC or C code for PIC16F84A to do the following:(assembly 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,
 

ahmad_abdulghany

Advanced Member level 4
Joined
Apr 12, 2005
Messages
1,209
Helped
102
Reputation
206
Reaction score
21
Trophy points
1,318
Location
San Jose, California, USA
Activity points
11,781
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 :cry:
Ahmad,
 

eng_ahmed22

Full Member level 4
Joined
Jun 7, 2005
Messages
190
Helped
20
Reputation
40
Reaction score
5
Trophy points
1,298
Activity points
2,944
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
 

ahmad_abdulghany

Advanced Member level 4
Joined
Apr 12, 2005
Messages
1,209
Helped
102
Reputation
206
Reaction score
21
Trophy points
1,318
Location
San Jose, California, USA
Activity points
11,781
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,
 

yousafzai

Full Member level 5
Joined
Jun 1, 2006
Messages
244
Helped
15
Reputation
30
Reaction score
8
Trophy points
1,298
Activity points
2,295
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.
 

haytham

Full Member level 4
Joined
Jun 6, 2004
Messages
229
Helped
16
Reputation
32
Reaction score
2
Trophy points
1,298
Activity points
1,365
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.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top