Continue to Site

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.

PIC16F877 - Hall Effect Throttle - PWM DC Motor Control

Status
Not open for further replies.

HeavyJ

Newbie level 1
Joined
Mar 29, 2010
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
Toronto
Activity points
1,304
Hello,

I finally built a working development/programming station for the 16F877. Switching from POSIX-threads-C to assembly language.

I could use some help with the assembly code and parts for these Sub-Sections of the DC-motor throttle project I am working on:
---------------------------------------------------------------------------------------------

Using 8-bit arithmetic, extract four decimal digits from the ADC 10-bit number generated from a Hall Effect sensor?

* Using 4 multiplexed 4511 7-Segment latch drivers with common-cathode displays.

*I can easily extract 3 decimal digits from an 8 bit register.

My guess:

1000 = 512 + 256 + 128 + 64 + 32 + 8

100 = 64 + 32 + 4

Therefore:

1) For the first two digits, work only with most significant Byte.

2) Use 2's complement subtraction of 250, and then 25. You have gone too far when the "C" bit in the status register is 0, so reverse the subtraction. This will extract the first 2 digits.

3) Perform 2 left bit-shifts on the remainder, pulling-in the 2 least significant bits.

4) Use 2's complement subtraction of 10 until the "C" bit hits 0, then step back.

5) What's left is the ones digit.
---------------------------------------------------------------------------------------------

What is the part number of a good Hall Effect position sensor for a linear throttle control lever? Then where can I get it? I will be feeding the signal into the the ADC module of the PIC16F877 micro-controller.
---------------------------------------------------------------------------------------------

How do I feed the 10 bit value out of the ADC module into the PWM module, or should I stick in only the most significant Byte? (haven't read data sheet yet)
-------------------------------------------------------------------------------------------

What is a proper frequency if I want to drive a 12-Volt 300-Watt brushed DC motor with the signal? I am running a 4MHz crystal.
--------------------------------------------------------------------------------------------

What sort of buffers and power transistors should I use to feed a 12-volt lead-acid battery into the motor, from the PWM PIC output?
--------------------------------------------------------------------------------------------


All the very best,

JohnPaul Adamovsky

- https://www.pathcom.com/~vadco/deep.html
- https://www.pathcom.com/~vadco/dawg.html
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top