Skip to content

VELOOS Example 3

This example for PIC12F675 implements set of “actuators” and “generators” controlled via USART. Actuators produce one 300 ms pulse when it receives command ‘ON’ and three 100 ms pulses delimited with 100 ms spaces (pauses) on command ‘OFF’. Generators, when turned on, produce pulses and spaces of the specified duration (1..255).

Actuators and Generators are implemented as instances of Actuator and Generator classes. Yet another class in this example protocol driver parses the incoming via software USART commands and forwards it to a corresponding object. Command format is: command[data,[data]]; COM port settings: 2400, 8bit no parity, 1 stop bits.
USART is implemented in software and uses INT0 and TMR1 interrupts for timing bits.
Command language consist of 8 commands (H..O)

  • H,I,J control an actuator,
  • K,L control a generator,
  • N all actuators do OFF, susped all generators
  • O all actuators do ON, resume all generators.

H,I,J commands accepts ‘0’ and ‘1’ as a parameter to execute OFF or ON command respectively. K,L commands should be supplied with pulse and pause duration

For example:

  • H0 Actuator 1 do OFF
  • LUA Turn on generator 1 with 85 ms pulse and 65 ms space

Example 3 Sources

Hardware Scematics. Connect loads to GP0,GP1,GP4,GP5 (not shown on the schematic)

Example 3 Hardware Schematics

Simulation Results

Simulation Results

Post a Comment

Your email is never published nor shared. Required fields are marked *
*
*

*

This blog is protected by dr Dave\'s Spam Karma 2: 202 Spams eaten and counting...