how to use an adapt812DX microcontroller with parallax servo controller
plasma
Posts: 3
hi
I am new to micro-controllers. I am given a adapt812DX( http://www.technologicalarts.com/myfiles/ad812dx.html·)
and i am suppose to use it to interface with a parallax servo controller (PSC).
From what i learnt, the PSC has 3 inputs from the controller - grd, 5V and serial in.
My question is how do i obtain the serial in from the adapt812dx? I have read thru the manuals of the adapt812 and i have totally no idea about how to tap correct output of the serial in.
And is it possible for me to share the same power supply for both micro-controller and the servo controller?
Thanks for replying
·
I am new to micro-controllers. I am given a adapt812DX( http://www.technologicalarts.com/myfiles/ad812dx.html·)
and i am suppose to use it to interface with a parallax servo controller (PSC).
From what i learnt, the PSC has 3 inputs from the controller - grd, 5V and serial in.
My question is how do i obtain the serial in from the adapt812dx? I have read thru the manuals of the adapt812 and i have totally no idea about how to tap correct output of the serial in.
And is it possible for me to share the same power supply for both micro-controller and the servo controller?
Thanks for replying
·
Comments
http://www.parallax.com/dl/docs/prod/motors/ServoController.pdf
It should be pretty clear how to communicate with the PSC from reading that. The documentation for your Adapt product should be able to help you on how to control from that end.
Ryan
Ryan
I have found this C++ code for testing the microcontroller.
#include "HC12.h"
int function(int a, int b, int c, int d){ int e;
· e = a+b;
· return e;
}
int f;
void main(void){
· COPCTL = 0x00;· // disable COP
· f = function(1,2,3,4);
· DDRT = 0xFF;·· // PortT is output
· DDRJ = 0x00;·· // PortJ is input
· while(1){
··· if(PORTJ&0x01){
····· PORTT=0xFF;·
··· }
··· else{
····· PORTT=0x00;
··· }
· }
}
extern void _start();
#pragma abs_address:0xfffe
void (*reset_vector[noparse]/noparse)() = { _start };
#pragma end_abs_address
May i know what is the meaning of the "pragma" and "extern void _start();"
thanks a lot
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas, TX· USA
Now i have another question.
Since the PSC (parallax servo controller) uses a basic stamp code, how can i implement using C++ in the microcontroller to drive the servo controller?
Do you have some basic C++ sample programs to run the servo controller as my C++ knowledge is quite limited?
thanks a lot!!
yongway
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
DTQ
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas, TX· USA