| Author |
Message |
|
|
Posted: Mar 06, 2012 - 11:59 PM |
|


Joined: May 04, 2007
Posts: 3529
Location: Geelong Australia, Home of the "Cats"
|
|
|
Quote:
i use ASCII commands
What does the gpredict/PC use?
Ie. what is the protocol/message structure? If you don't have that, you can't do anything! |
_________________ Charles Darwin, Lord Kelvin & Murphy are always lurking about!
Lee -.-
(If you haven't already done so, edit your PostNuke profile and let let us know where you are, what you do & what your interests are.)
|
| |
|
|
|
|
|
Posted: Mar 07, 2012 - 12:11 AM |
|

Joined: Aug 14, 2011
Posts: 135
|
|
Sir Ldevries,
I am from Germany,
can you please tell how to select the satellite from gpredict and as you said the keplerian elements, lat & long & UTC time calculates the angles and sends them serially to a COM port.
as i am using COM6 ,So i can read lat &long from it right . |
_________________ Thanking You
Mahaveer
|
| |
|
|
|
|
|
Posted: Mar 07, 2012 - 12:16 AM |
|

Joined: Aug 14, 2011
Posts: 135
|
|
Mr.LDevries,
I am from Germany,
can you please tell how to select a satellite from gpredict .And as you said the Lat and Long will be send to the COM port.
i am using COM6 so all the data will be at this port. |
_________________ Thanking You
Mahaveer
|
| |
|
|
|
|
|
Posted: Mar 07, 2012 - 12:34 AM |
|


Joined: May 04, 2007
Posts: 3529
Location: Geelong Australia, Home of the "Cats"
|
|
I cannot find the .pdf file that is supposed to be available??
Anyway, the attached picture shows you how to select the satellite you want to track.
You need to set up a station file to tell it where you are.
You also need to set up the radio interface & the rotator interface, but without documentation, I am also in the dark!
Edit.
OK, I've got the picture that hamlib is the back end daemon for Gpredict which will have the serial interface to the hardware.
Just how to set up the connection from Gpredict to Hamlib, I have not worked out yet, nor do I know how to set up hamlib to select a particular COM port. I believe you should get that working first. You should be able to test that out using Br@ys terminal to discover the protocol.
I don't see it as an AVR issue at this time! |
_________________ Charles Darwin, Lord Kelvin & Murphy are always lurking about!
Lee -.-
(If you haven't already done so, edit your PostNuke profile and let let us know where you are, what you do & what your interests are.)
|
| |
|
|
|
|
|
Posted: Mar 07, 2012 - 01:58 AM |
|


Joined: Jul 02, 2005
Posts: 5940
Location: Melbourne, Australia
|
|
Mahaveer,
Below is what I believe you have or want. You enter the information into the PC via the keyboard. The gpredict software then sends a message via COM6 to your AVR board. The Bascom code on the AVR board interprets the azimuth and elevation angles and controls the antenna rotors to point at those angles. Is that correct? If yes, we are saying that you need to tell us what is the format of the message going between the PC and your AVR board. Yes we know it uses the RS232 voltage levels, but what is inside the message? How is it constructed? For example is it something like ...
AZ=274,EL=32CRLF
If it is like above, your Bascom code (in its simplest form) would extract the string 274, convert it to the number 274 and command the rotor electronics to move to match this value. Same for the elevation.
Cheers,
Ross |
_________________ Ross McKenzie
ValuSoft
Melbourne Australia
|
| |
|
|
|
|
|
Posted: Mar 07, 2012 - 09:10 AM |
|

Joined: Aug 14, 2011
Posts: 135
|
|
Valusoft,
Sir you are exactly right,what i am looking at.
The construction message which i get is(string format)
AZaaa.a ELeee.e UPuuuuuuuuu UUU DNddddddddd DDD
eg:-az045.00el110.00
The Az and El values (aaa.a and eee.e) are not fixed width. They are in degrees and include 1 decimal place.
The Up and Dn frequencies are in Hz.
UUU and DDD are the uplink and downlink mode.
Now my bascom code should extract these angle and command the rotor electronics to move to match this value. Same for the elevation. |
Last edited by mahaveer on Mar 07, 2012 - 09:26 AM; edited 2 times in total
|
| |
|
|
|
|
|
Posted: Mar 07, 2012 - 09:25 AM |
|

Joined: Aug 14, 2011
Posts: 135
|
|
Ldevries,
Sir, Yes hamlib is the back end daemon for Gpredict which will have the serial interface to the hardware.
Just how to set up the connection from Gpredict to Hamlib, I have worked out,I know how to set up hamlib to select a particular COM port.
this is the command to setup the COM port and the MY motor from command window.
c:\user\mahaveer.s> rotctl -m 201 -r com6 -s 4800 -vvvvv
here m ---> motor ID
r ---> COM port (com6)
s ---> baud rate
v --->verbose
after executing the first command it jumpes into rotator controller where you can perform desire action
which i do is
rotcommand : P
azimuth :
elevation :
once's i enter my desire values here ,my bascom code should extract it and command the electronics to move to match this value
[b] |
|
|
| |
|
|
|
|
|
Posted: Mar 07, 2012 - 09:25 AM |
|


Joined: May 04, 2007
Posts: 3529
Location: Geelong Australia, Home of the "Cats"
|
|
So assuming you are happy about the RS232 interfacing you have two options.
a)store the string starting with AZ, until DDD has been received in a string and then parse the string or
b)parse the string as it is received.
If you do the latter, you could use a finite state machine and run it when a serial character has been received (interrupt driven). This gives the MCU plenty of time resource to handle the rotator & doppler shift correction.
Why not use GCC? |
_________________ Charles Darwin, Lord Kelvin & Murphy are always lurking about!
Lee -.-
(If you haven't already done so, edit your PostNuke profile and let let us know where you are, what you do & what your interests are.)
|
| |
|
|
|
|
|
Posted: Mar 07, 2012 - 09:36 AM |
|

Joined: Aug 14, 2011
Posts: 135
|
|
Sir,
how to start and
How can i do it with bascom. |
|
|
| |
|
|
|
|
|
Posted: Mar 07, 2012 - 09:43 AM |
|


Joined: May 04, 2007
Posts: 3529
Location: Geelong Australia, Home of the "Cats"
|
|
I know nothing about Bascom!
Can Bascom handle interrupts?
You could have a look at say a GPS NMEA parsing routine and modify it for your requirements as it essentially what you want. I know that plenty of NMEA parsers have been written in C, but I don't know about Bascom. |
_________________ Charles Darwin, Lord Kelvin & Murphy are always lurking about!
Lee -.-
(If you haven't already done so, edit your PostNuke profile and let let us know where you are, what you do & what your interests are.)
|
| |
|
|
|
|
|
Posted: Mar 07, 2012 - 10:08 AM |
|

Joined: Aug 14, 2011
Posts: 135
|
|
bascom can handle interrupts
as i was using bascom from the begging of my project.thats why i am asking how to use parses in bascom |
|
|
| |
|
|
|
|
|
Posted: Mar 07, 2012 - 12:30 PM |
|


Joined: Jul 02, 2005
Posts: 5940
Location: Melbourne, Australia
|
|
|
mahaveer wrote:
AZaaa.a ELeee.e UPuuuuuuuuu UUU DNddddddddd DDD
eg:-az045.00el110.00
In your definition of the string you show a space between the first two data strings, but your example does not show the space.
If it uses the space, you can parse the string easily using Bascom's SPLIT function.
Cheers,
Ross |
_________________ Ross McKenzie
ValuSoft
Melbourne Australia
|
| |
|
|
|
|
|
Posted: Mar 07, 2012 - 02:12 PM |
|

Joined: Aug 14, 2011
Posts: 135
|
|
Sorry
Eg :- az045.00 el110.00
their is space in between them.
How can i parse the string easily using Bascom's.And how to store them into separate variables. |
|
|
| |
|
|
|
|
|
Posted: Mar 07, 2012 - 02:19 PM |
|


Joined: Jul 18, 2005
Posts: 62281
Location: (using avr-gcc in) Finchingfield, Essex, England
|
|
|
|
|
|
|
Posted: Mar 07, 2012 - 02:35 PM |
|

Joined: Aug 14, 2011
Posts: 135
|
|
I did it
Bcount = Split( "az045.00 el110.00 " , Ar(1) , " ")
Dim J As Byte
For J = 1 To Bcount
Print Ar(j)
Next
End
output..
az045.00
el110.00
------------------------------------------------------
how can i store the only 045.00 and 110.00 into some other variable.so that i can use them |
|
|
| |
|
|
|
|
|
Posted: Mar 07, 2012 - 04:07 PM |
|


Joined: Jul 18, 2005
Posts: 62281
Location: (using avr-gcc in) Finchingfield, Essex, England
|
|
| Did you read that online help manual? I see functions LEFT() and RIGHT() that can split off substrings. As you want to drop the first two characters ("az" or "el") I would have thought RIGHT(string,3) would deliver? |
_________________
|
| |
|
|
|
|
|
Posted: Mar 07, 2012 - 05:28 PM |
|

Joined: Aug 14, 2011
Posts: 135
|
|
Ldeveries had posted a code of AVR in c but i would like to right that in bascom so how can i convert that program such that it works in bascom.
regarding USART. |
|
|
| |
|
|
|
|
|
Posted: Mar 07, 2012 - 06:13 PM |
|


Joined: Jul 18, 2005
Posts: 62281
Location: (using avr-gcc in) Finchingfield, Essex, England
|
|
I just searched "UART" on the Bascom support forum and got 871 hits. Do you not think one of those might have some code showing how to use the UART in Bascom?
Or how about the online manual for Bascom on the Mselec web site? It documents things like CONFIG SERIALOUT with full examples. |
_________________
|
| |
|
|
|
|
|
Posted: Mar 08, 2012 - 11:16 AM |
|

Joined: Aug 14, 2011
Posts: 135
|
|
please help me
as i cant find anything in the given above links.
How can i read and write using Uart in bascom |
_________________ Thanking You
Mahaveer
|
| |
|
|
|
|
|
Posted: Mar 08, 2012 - 11:26 AM |
|

Joined: Aug 14, 2011
Posts: 135
|
|
#define FOSC 1843200// Clock Speed
#define BAUD 9600
#define MYUBRR FOSC/16/BAUD-1
void main( void )
{
...
USART_Init ( MYUBRR );
...
}
void USART_Init( unsigned int ubrr)
{
/* Set baud rate */
UBRRH = (unsigned char)(ubrr>> ;
UBRRL = (unsigned char)ubrr;
/* Enable receiver and transmitter */
UCSRB = (1<<RXEN)|(1<<TXEN);
/* Set frame format: 8data, 2stop bit */
UCSRC = (1<<URSEL)|(1<<USBS)|(3<<UCSZ0);
}
void USART_Transmit( unsigned char data )
{
/* Wait for empty transmit buffer */
while ( !( UCSRA & (1<<UDRE)) )
;
/* Put data into buffer, sends the data */
UDR = data;
}
void USART_Transmit( unsigned int data )
{
/* Wait for empty transmit buffer */
while ( !( UCSRA & (1<<UDRE))) )
;
/* Copy 9th bit to TXB8 */
UCSRB &= ~(1<<TXB8);
if ( data & 0x0100 )
UCSRB |= (1<<TXB8);
/* Put data into buffer, sends the data */
UDR = data;
}
how can i write this code into bascomavr |
_________________ Thanking You
Mahaveer
|
| |
|
|
|
|
|