Member Since: April 8, 2007

Country: United States

  • I have been playing around with the Venus board and have developed a (Linux) Bash shell script to pull the $GPRMC message and display in a terminal window. It also checks for the (USB) port to use by reading the messages. Not elegant or pretty by a long shot, but it works...
    I have put it at my server here:
    Just copy to a file. Then run in a terminal window: sh
    I would like to post it here, but half the characters would be stripped.

  • Just an FYI: I have the Venus connected to an active antenna (VTGPSIA-3), and powered by 3.3v from the FT232RL breakout board, and connected to a laptop USB port. This setup draws less than the max 50 mA the breakout board allows at 3.3V. The active antenna is powered through the coax cable. I built the whole thing except the antenna in a 12V auto flasher square plastic case (DOT Approved :-). Took all of two hours to package the thing. Very small: 1 inch square and 1.5 inches long. The SMA connector comes out the top and the USB connects to the bottom. Nice!

  • An additional note is required here on the error I was getting. In the original article's formula for MYUBRR, if I placed () around the formula, the error mentioned goes away. Like:
    #define MYUBRR (FOSC/16/BAUD-1)
    get's rid of this warning around line 65 or so:
    //USART Baud rate: 9600
    UBRR0H = MYUBRR >> 8;
    In function 'ioinit':
    warning: suggest parentheses around '-' inside '>>'

  • For what it's worth, the formula for error percentage is:
    (( desired baudrate / actual baudrate) - 1) * 100
    The actual baudrate is:
    The UBRR value is:
    desired baudrate))-1
    I have found that in C++ sometimes the order of calculations don't work in the standard order (MDAS) as expected, if put in certain data structures. ...or, it could be the operator... :-)

  • Forgot to mention; this works both breadboarded and on my stk500.
    And I am using a FT232RL breakout board I got for another project. Makes it very simple to use, just a couple of jumpers: TX, RX, and GND. I don't have any MAX232 chips.

  • Okay, so now I've tested it with the internal oscillator set at 8 MHz and the lfuse div8 off and it works fine. I also changed the following:
    #define FOSC 8000000
    #define MYUBRR 51
    in order for everything to be in sync. I was getting an error before I changed the above MYUBRR, in this line:
    //USART Baud rate: 9600
    UBRR0H = MYUBRR >> 8;
    It may not be as accurate as with an external crystal, but the part count is lower. :)

  • Don't know where has been mentioned, but somewhere in here it refers to downloading the amtega168 manual. In that manual, on page 195+ are tables that show the UBRRn value and the associated baud rate error for several clock frequencies. So, unless I am misreading this, by setting the internal 8 MHz clock to NOT divide by 8 (lfuse bit 0x7 to 1), the error percentage for 9600 baud drops from ~7 to 0.2. This may alleviate the need for an external crystal.

  • Are you using hardware or software control for the terminal program? Even with the TX-RX connection, if you haven't connected DTR-DSR, and RTS-CTS together, you may not see anything. Easy way is to turn off hardware and software control in the setup for your terminal program. I am using minicom in Linux, and the FTDI USB-232 breakout board and I had to do the same thing to test that board, even though it is for a GPS receiver and not the M168.

  • Ye gads! I forgot about the stripping of characters here. The include lines should read:
    include avr/io.h with 'less than' before and 'greater than' symbols after the avr/io.h. Same with the util/delay.h.

  • First off, I too am a rank beginner with the Atmega168, et. al. But I just wanted to share what I might use as a blink.c code to simplify the delay piece:



    // delay.h is a standard avr-libc library module
    int main (void)
    // set PORTC pin 1 (PC0) for output
    DDRC = 0x01;
    while (1)
    // set LED off
    PORTC = 0xfe;
    // set LED on
    PORTC = 0xff;
    return 1;

No public wish lists :(