SC16A FAQ

Autonomous Robot, Manual Robot, DC Motor Driver, Stepper Motor Driver, Servo, Multi PWM chip.....

SC16A FAQ

Postby spammermanager » Tue Feb 22, 2011 10:27 pm

Hello,

Why there is no FAQ for SC16A section above?

My robot is not moving when I build PR18 Biped Walking Robot using 18F452 with the LCD being removed. For your information, I just copy all the source code provided from cytron and edit the code because I am not using the LCD screen.
I checked all the connection and it is correct according to the circuit diagram. Is there any problem in software part? It seems like the MCU did not send the data to the SC16A. How to check whether the PIC send the data or not?

5V indicator and servo power LEDs are lighten up. Just after I connect 5V to the SC16A, LED for Tx and Rx are on. Then LEDs off.
I used the Servo GUI and the servo is functioning well.

What is the problem actually?

Thank you.
spammermanager
Newbie
 
Posts: 8
Joined: Sat Feb 19, 2011 12:48 am

Re: SC16A FAQ

Postby hyng » Wed Feb 23, 2011 10:46 am

Seems like the SC16A has no problem if it is working with PC. Please make sure the UART connection is correct, MCU's TX connect to SC16A's RX and MCU's RX connect to SC16A's TX. If i'm not mistaken the PIC use in PR18 is PIC16F876A. Did you successfully modified the code to suit your PIC18F?
User avatar
hyng
Moderator
 
Posts: 292
Joined: Thu Apr 16, 2009 11:35 am

Re: SC16A FAQ

Postby spammermanager » Wed Feb 23, 2011 10:29 pm

I really don't have any idea whether my code is suit for PIC18F452 or not. Is there any major different between that? I just change the header and some UART setting according to PIC18Fxx2 datasheet.
spammermanager
Newbie
 
Posts: 8
Joined: Sat Feb 19, 2011 12:48 am

Re: SC16A FAQ

Postby ober » Thu Feb 24, 2011 9:20 am

PR18 is working as it is being tested before it is released.

Of course as pointed out by hyng, if the hardware is not correctly installed, you will have problem.

Another possible reason is the code. PR18 is using PIC16F as the microcontroller, as porting to PIC18F will need to modify some of the register, configuration bits, header files, IO pin register, etc.

Furthermore, without LCD, you are not sure how is the operation procedure. Have you modify the program to start right after reset? Because if I am not mistaken, PR18 require user to calibrate the servo by using the push buttons. It will not execute the walking program right away.
Ober Choo
Cytron Technologies Sdn Bhd
www.cytron.com.my
User avatar
ober
Moderator
 
Posts: 1440
Joined: Wed Apr 15, 2009 1:03 pm

Re: SC16A FAQ

Postby spammermanager » Thu Feb 24, 2011 4:45 pm

Header:
CODE: SELECT_ALL_CODE
#include <p18f452.h>


Here's how I setup UART for PIC18F:
CODE: SELECT_ALL_CODE
   SPBRG = 15;                     
   TXSTAbits.BRGH = 0;   
   TXSTAbits.TXEN = 1;   
   RCSTAbits.CREN = 1;   
   RCSTAbits.SPEN = 1;   
   
   PIR1         = 0b00100000;
   //PIR1bits.TXIF   = 0;
   //PIR1bits.RCIF   = 1;


And below is the function prototype in my code:
CODE: SELECT_ALL_CODE
void action_1(void);
void action_2(void);

void delay(unsigned long data);         

void uart_send(unsigned char data);

unsigned char uart_rec(void);   //UART receive

void send_cmd(unsigned char num, unsigned int data, unsigned int ramp);


The other parts are same as in PR18 source code but without LCD display installed.
I already checked the circuit and yes, MCU's TX connected to SC16A's RX and MCU's RX connected to SC16A's TX. I think there is no mistake for hardware part. The problem might be in software part since this is my first time dealing with UART.

Hope you guys out there can help me as much as you can. Thank you.
spammermanager
Newbie
 
Posts: 8
Joined: Sat Feb 19, 2011 12:48 am

Re: SC16A FAQ

Postby robosang » Thu Feb 24, 2011 9:31 pm

not really familiar with PR18, what is that? OK, searching Cytron site result in a walking biped robot.

What is the frequency of your crystal and what is your configuration setting for OSC?
robosang
Expert
 
Posts: 1239
Joined: Wed Jun 10, 2009 5:37 pm

Re: SC16A FAQ

Postby spammermanager » Thu Feb 24, 2011 11:30 pm

I am not configure OSC and crystal frequency is 10MHz.
I tried to program the servo using SC16A. That's why I choose PR18. :D
spammermanager
Newbie
 
Posts: 8
Joined: Sat Feb 19, 2011 12:48 am

Re: SC16A FAQ

Postby robosang » Mon Feb 28, 2011 9:04 pm

You did not set the OSC configuration bit? Most probably is it not HS or EC. Try to set the OSC bit.
robosang
Expert
 
Posts: 1239
Joined: Wed Jun 10, 2009 5:37 pm


Return to Robot Controller

Who is online

Users browsing this forum: No registered users and 5 guests