Controlling Maestro 6 channel servo controller

General discussion on mikroC PRO for PIC.
Author
Message
vanepico
Posts: 15
Joined: 05 Jan 2010 10:40

#16 Post by vanepico » 09 Jan 2010 19:41

Well it varies from 1ms to 2 ms

vanepico
Posts: 15
Joined: 05 Jan 2010 10:40

#17 Post by vanepico » 11 Jan 2010 18:54

Does mikroe support something like pulsin/pulsout?

fogshore
Posts: 2
Joined: 11 Jan 2010 21:26

#18 Post by fogshore » 11 Jan 2010 21:30

vanepico wrote:Does mikroe support something like pulsin/pulsout?
I think soo.,.

vanepico
Posts: 15
Joined: 05 Jan 2010 10:40

#19 Post by vanepico » 11 Jan 2010 22:12

Could you be a little more elaborate? :)

vanepico
Posts: 15
Joined: 05 Jan 2010 10:40

#20 Post by vanepico » 14 Jan 2010 03:03

Does anyone have any help about the timer?

User avatar
mileta.miletic
mikroElektronika team
Posts: 493
Joined: 05 Jun 2009 14:46
Location: Belgrade, Serbia
Contact:

#21 Post by mileta.miletic » 14 Jan 2010 14:33

Hi,

check Manchester example, part of the code use timers and interrupts to measure the length of the pulse, it could help:
http://www.mikroe.com/forum/viewtopic.php?p=36740#36740
Regards,
Mileta

Acetronics
Posts: 715
Joined: 27 Dec 2006 14:33
Location: Le Tréport , FRANCE

#22 Post by Acetronics » 14 Jan 2010 15:45

Hi,

"Xor" has provided lots of relevant codes all along these forums ( C and Basic ) ...

just use the SEARCH function for keyword Pulsin or Pulse or servo ...

But NO "full software" functions like used for genuine " Pulsin" :roll: ...

Alain

vanepico
Posts: 15
Joined: 05 Jan 2010 10:40

#23 Post by vanepico » 15 Jan 2010 01:40

there are some at http://www.mikroe.com/forum/viewtopic.php?t=16606, wondering if i could modify them for use with more than one channel

pacai1987
Posts: 12
Joined: 17 Jan 2010 19:03

#24 Post by pacai1987 » 17 Jan 2010 19:13

Code: Select all

void main() {
  TRISA=0b01000010;   // Added 0b for binary
  TRISB=0b00000000;   // Added 0b for binary
  Soft_UART_Init(PORTA, 1, 2, 9600, 0);
  Delay_ms(5000);
    while(1)
  {
  Soft_UART_Write(0xAA);
  Soft_UART_Write(12);
  Soft_UART_Write(4);
  Soft_UART_Write(0);
  Soft_UART_Write(112);
  Soft_UART_Write(46);
  ///Soft_UART_Write(132);
  ///Soft_UART_Write(0);
  ///Soft_UART_Write(112);
  ///Soft_UART_Write(46);
  Soft_UART_Break();
  PORTB=255;
  Delay_ms(500);
  PORTB=0;
  Delay_ms(500);
  }
  }
this programming cant work or can? where the mistake?

vanepico
Posts: 15
Joined: 05 Jan 2010 10:40

#25 Post by vanepico » 18 Jan 2010 14:38

Excuse me? no that does work, you need an '&' in front of the PORTA

vanepico
Posts: 15
Joined: 05 Jan 2010 10:40

#26 Post by vanepico » 20 Jan 2010 03:25

*does not work

User avatar
anikolic
mikroElektronika team
Posts: 1775
Joined: 17 Aug 2009 16:51
Location: Belgrade
Contact:

#27 Post by anikolic » 20 Jan 2010 10:53

Hi,
vanepico is right. All you need to do is correct Soft_Uart_init to look like this:

Code: Select all

Soft_UART_Init(&PORTA, 1, 2, 9600, 0);
Your code works just fine, I have tested it using PIC16F84A @ 4MHz XT oscillator.

Best regards,
Aleksandar
Web Department Manager

pacai1987
Posts: 12
Joined: 17 Jan 2010 19:03

#28 Post by pacai1987 » 22 Jan 2010 10:36

if i wanna send 4 bytes of data to my servo controller using pic18f452 through rx tx.. should i use uart or soft uart.. i confuse

User avatar
anikolic
mikroElektronika team
Posts: 1775
Joined: 17 Aug 2009 16:51
Location: Belgrade
Contact:

#29 Post by anikolic » 27 Jan 2010 15:13

Hi,
You may use whichever you want. There are advantages and disadvantages in each:
1. UART is much more reliable, because it uses internal hardware module for communication and error detection. But you can only use it on specific PORT pins, which are defined as module output.
2. Soft_Uart is a software simulation of this hardware module, so it relies on much more factors which all have certain room for errors, so in final summation, Soft_Uart is less reliable than UART. Nevertheless, it has the advantage of being able to be tied to any available PORT pins.
3. Alternatively you should consider using hardware UART on chips where you can program the output pin location. Peripheral Pin Select option is now introduced in many new chips, so you should check it out. We have a library that supports those hardware options.

Best regards,
Aleksandar
Web Department Manager

fogshore
Posts: 2
Joined: 11 Jan 2010 21:26

#30 Post by fogshore » 01 Feb 2010 16:54

okay..יי
...
[url=http://www.tosuccess.co.il]ייעוץ עסקי[/url]
[url=http://www.starlitt.com]בניית אתר לעסק[/url]

Post Reply

Return to “mikroC PRO for PIC General”