No Flow chat.

Electronics Computer Programming Q&A
Post Reply
frank_fg
Posts: 23
Joined: Tue Apr 29, 2008 9:07 am
Contact:

No Flow chat.

Post by frank_fg »

:smile:


Hi!

I am having probels with uploading Word.

I have tryed four tiomes.

Can you help me

thanks

Frank G.
frank_fg
Posts: 23
Joined: Tue Apr 29, 2008 9:07 am
Contact:

No flow chart.

Post by frank_fg »

:smile:
NO FLOW CHART

Hi!

Could use some help in a program that I wrote from a programming course on how to remotely control a D.C. motor.

Sorry this is going to be a little lengthily.

The programs work except that I want to modify them to suit my purpose. And that were the problem starts. There is no flow chart, so it makes it a little harder to follow. You would think, in that I wrote the program and read all the particulars that I would know how to do it. Well, in my brain I know how it works. But I get lost in the detail and that were I could use some help.

Remote Control of a motor

1 – There is a Display Driver Module that is called the Master that uses
the PIC16F88 and
2 – There is a slave module that uses the PIC16F88 to drive the motor.

3 – On the Display Driver Module there is a LCD and Keypad.
4 – The Display Driver Module connects to the Slave via a ribbon cable.

5 – Communication from the Display Driver Module to the Slave Module is
by a RS232 - USART, That is in the PIC’s PIC16F88.

If all is well, which it is, by turning the power on, the LCD will display:

‘Controller Number’ and the motor starts to run.
a red led will light on the motor
control module (slave).
Press 1 on the keypad and

’Motor 1 or 2’ will be displayed on LCD

Press 2 on the keypad and

‘Ref emf 001 – 255’ will be displayed on the LCD

Press 0 then 1 then 0 the message on the top line changes to

* = send # = cancel and the bottom line will display

1 2 0 1 0

Press * to send the new reference emf to the Motor
Control Module.


As you can see, by turning the power on the motor started to run.
I don’t want that to happen. I want to select the controller first.

Shot me down, when I start to stray. And I expect to, cause I get lost in the detail.

1, I would like to not have the motor running at this stage.

2, I would like to select which motor to run via, ‘Motor 1 or 2’ cmd as
displayed above.

3, only after the Ref level is given ‘Ref 001 – 255’ do I wan the motor to
start.

4, by the way to stop the motor I need to give it the Ref 000, that’s
another thing I need to do.

Slave Programmed

After the EQU’s it goes to,

goto start
org 0004h
goto start ;Interrupt vector..

org 0005h ;Start of programme memory.
Start: call setupmots ; setup for motor slave.
call setusart
“
“
“
movlw 25
movwf reflevel1 ;Set motor 1 ref level to 0.5 V
movlw 51
movwf reflevel2 ;Setup motor 2 ref level to 1.0 V
clrf addrrp ; Set address pointer to zero


Pulse btfss portb,4 ;Skip if motor 2 is on.
call comp2 ;If off test speed of motor 2.
call testip ;Test input data from USART.
btfss portb,3 ;Skip if motor 1 is on.
call comp1 ;If off test speed of motor 1.
call testip ;Test input data from USART.
btfsc portb,4 ;‘Skip if motor 2 off.
call ontimer2 ;If on decrement motor 2 counter.
btfsc portb,3 ;Skip if motor 1 is off.
call ontimer1 ;If on decrement motor 1 counter.
goto pulse


Testip: bsf portb,rb0 ;Red Led on.
call rxw ;Test for new serial data.
btfss statu,z ;If z set then new data.
return ;Return if z is clear.
call txw ;Send same data byte back.
movwf reflevel2
bsf portb,rb1 ;Green Led on.
return

LIBF88G.


The green Led on the Motor Control Module will light to show that a character has been received and
the motor will slow down to it new speed level setting..

The master is asking the questions to select which slave to address and which motor to select but so far
It is only programmed to send the reference level without any preamble.

I would like to first programme the slave to stop on ref level 000.

I think the answer is in the Testip routine. Under test for new serial
data.

I need to get the library code in to see more clearly.

I hope this enough for now.

Frank G.
User avatar
MrAl
Posts: 3862
Joined: Fri Jan 11, 2002 1:01 am
Location: NewJersey
Contact:

Post by MrAl »

Hi Frank,

Sorry to say that some programs get pretty involved, with lots of
instructions to do lots of things, and this takes *a lot* of time to
go through and think about and make corrections or improvements.
This is why it might be a little hard to get help when it comes to
actually designing the program itself.
If there are specific questions many people are willing to help, like
when the ad converter wont read or something like that, or even
if a PWM doesnt seem to be working right. When it comes to going
over the entire program step by step and trying to think about what
you are trying to accomplish, sometimes the best person to do the
job is you yourself, especially since you have the most complete
knowledge of what you are trying to do and what you have done
already.

I hope you have tried simpler projects before attacking this one,
because that would help you understand how to do what you want
to do now with a more complex one.
LEDs vs Bulbs, LEDs are winning.
Post Reply

Who is online

Users browsing this forum: No registered users and 22 guests