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,
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,