Search found 75 matches

by TomasS
Wed Jan 26, 2011 4:19 am
Forum: Flowcode V4
Topic: Simple servo program
Replies: 12
Views: 8615

Simple servo program

Hi I would like to make a simple servo program on a ATmega32 platform. I would like it to have 2 push-button inputs so that if no button is pressed the servo is positioned in the middle position. Pressing the first button, the servo turns to the right position and pressing the second turns it to the...
by TomasS
Thu Jan 06, 2011 8:09 pm
Forum: General / Misc
Topic: Latching switches?
Replies: 10
Views: 15235

Re: Latching switches?

Your getting there, LED flashing is better then nothing happening at all. Precise! No action = headache :P The problem is the C code you posted, has got important information missing. E.g timer0 interrupt settings. When you find that information, it would be easy to count from 6 to 250. Although it...
by TomasS
Thu Jan 06, 2011 6:11 pm
Forum: General / Misc
Topic: Latching switches?
Replies: 10
Views: 15235

Re: Latching switches?

Hello again medelec35 Thanks for you reply. I have tried out your suggestions. Now the LED is flashing as wanted by changing the calculation done inside the macro to Port_B= (Port_B XOR 0b11111111) AND 128. I did forget to select the clock source prescaler to 1:1 for TMR0 :oops: Unfortunate I were a...
by TomasS
Mon Jan 03, 2011 8:29 pm
Forum: Components (Other)
Topic: pwm examples needed
Replies: 43
Views: 62148

Re: pwm examples needed

The servo component in V4 versions of Flowcode (AVR,PIC and ARM) is an improved version of the original example program. It automatically adjusts to accommodate a wide range of target devices and clock speeds. Hi Sean No question asked! But now you can add 1 - 8 servo from the Mechatronics menu, bu...
by TomasS
Mon Jan 03, 2011 8:21 pm
Forum: General / Misc
Topic: Latching switches?
Replies: 10
Views: 15235

Re: Latching switches?

Hiya TomasS The Very simplest way to toggle bits of a port in flowcode is like this: Bit Toggle.jpg Or you can control individual bits of a byte by: Bit_Toggle = (Bit_Toggle XOR 0b11111111) AND 1 in a calculation box. The value of 1 on the right is the bit of the byte you want to toggle. E.g to tog...
by TomasS
Sun Jan 02, 2011 4:57 pm
Forum: General / Misc
Topic: Latching switches?
Replies: 10
Views: 15235

Re: Latching switches?

Bit manipulation of a byte can be done like this. Bit shifting Left say you have this 8-bit variable byte = 0b00000001 to bit shift left we could do the following. byte = byte * 2 or byte = byte << 1 They both will manipulate the byte to look like this byte = 0b00000010 In C, you can do bitmanipula...
by TomasS
Wed Dec 29, 2010 12:48 pm
Forum: Programming Tips & Tricks
Topic: Multiple Servo Control
Replies: 12
Views: 16846

Re: Multiple Servo Control

The servo control program uses C code blocks within the Flowcode program to provide direct access to device specific timer registers. This causes the AVR code to fail to compile when imported directly from the PIC version. A quick check of the ATmega8 data sheet indicates that the necessary functio...
by TomasS
Thu Dec 23, 2010 6:48 pm
Forum: Components (Other)
Topic: pwm examples needed
Replies: 43
Views: 62148

Re: pwm examples needed

Hello Chevvy We have a 8 channel servo example that Sean has put together. This uses the Timer1 module and two hardware capture compare interrupts. The CCP1 Interrupt controls the individual Servo positions and the CCP2 interrupt controls the overall cycle of the timer1 counter (eg to fit in 8 diff...
by TomasS
Wed Dec 09, 2009 7:21 pm
Forum: General / Misc
Topic: Using STK500 with Flowcode
Replies: 23
Views: 26609

Re: Using STK500 with Flowcode

The data sheets for all the AVR devices can be downloaded from the Atmel website. The fuse settings are generally in the Memory Programming section. The values sent from Flowcode are: 0x0,<high fuse bite> 0x1,<low fuse bite> 0x2,<extended fuse byte> Not all fuse bytes are supported by every device ...
by TomasS
Wed Dec 09, 2009 4:06 pm
Forum: General / Misc
Topic: Using STK500 with Flowcode
Replies: 23
Views: 26609

Re: Using STK500 with Flowcode

The fuse settings I sent previously were to configure the chip to run from an external XTAL source - the one on the STK500 board. The option to allow use of Port B 6/7 is to run from the internal calibrated RC oscillator. The fuses can select operation from the internal oscillator at 1, 2, 4 and 8 ...
by TomasS
Wed Dec 09, 2009 2:00 pm
Forum: General / Misc
Topic: Using STK500 with Flowcode
Replies: 23
Views: 26609

Re: Using STK500 with Flowcode

I have downloaded and tested your program. It is runnung correctly on my system, but the results displayed on the leds initially appear to be confusing. There are 2 reasons for this: The STK500 leds are commoned to the positive supply voltage, so a high level on a port pin will turn the connected l...
by TomasS
Wed Dec 09, 2009 12:08 pm
Forum: General / Misc
Topic: Using STK500 with Flowcode
Replies: 23
Views: 26609

Re: Using STK500 with Flowcode

Can you send a zip folder contaning the .fcf_avr file and the .c file created by Flowcode? I will also need to know the configuration fuse values you are using. Have these been re-programmed from Flowcode, or are they the default values set by the manufacturer - which need to be changed. I sent the...
by TomasS
Wed Dec 09, 2009 11:35 am
Forum: General / Misc
Topic: Using STK500 with Flowcode
Replies: 23
Views: 26609

Re: Using STK500 with Flowcode

I have now successfully downloaded a program directly from Flowcode to an STK500 target board, using the AVRISPmkII programmer. The only problem with my standard setup was the presence of the RESET jumper. This needs to be removed to allow the ISP programmer to take control of the RESET line - othe...
by TomasS
Mon Dec 07, 2009 7:02 pm
Forum: General / Misc
Topic: Using STK500 with Flowcode
Replies: 23
Views: 26609

Re: Using STK500 with Flowcode

The problem is that no new laptops has a serial port today - so no of the students can use a serial port for the STK500. Just a thought. Would either a USB to RS232 serial lead or a RS232 Bluetooth adaptor work? That was my immediate idea, but I hoped someone could confirm that it does.. I don't be...
by TomasS
Mon Dec 07, 2009 6:58 pm
Forum: General / Misc
Topic: Using STK500 with Flowcode
Replies: 23
Views: 26609

Re: Using STK500 with Flowcode

Hello Are you powering the board when you try to program the device. The AVRISPII device should light up green when all of the connections are ok and the board is powered up. A red LED may also suggest a back to front ISP header on the board. Hi Benj When the AVRASPmkII is connected to the STK500 u...
by TomasS
Sun Dec 06, 2009 9:19 pm
Forum: General / Misc
Topic: Using STK500 with Flowcode
Replies: 23
Views: 26609

Re: Using STK500 with Flowcode

Hi Sean If you already have an AVRISPmkII working from Flowcode, you can simply connect it to the ISP connector of the STK500 board, which can then be used as a target/development board without any changes to settings. I have an AVRISPmkII, but tried connecting it to the ISP port SPROG2 on http://fa...
by TomasS
Wed Dec 02, 2009 7:44 pm
Forum: General / Misc
Topic: Using STK500 with Flowcode
Replies: 23
Views: 26609

Using STK500 with Flowcode

Hi I am a newbe using Flowcode and would like to use an STK500 as platform. But how do I setup Flowcode to use the STK500? Should I connect an AVRISP MKII to the ISP connector on the STK500 or should I use a USB to RS232 converter and connect to the DP9-connector? I hope there is a helpful person in...
by TomasS
Fri Nov 06, 2009 1:56 pm
Forum: Bugs / Application Errors
Topic: Cannot Program via AVRISP MK2
Replies: 18
Views: 21952

Re: Cannot Program via AVRISP MK2

If you are using the same target device and configuration settings for all your future projects, you will never need to program the fuses again. You will need to re-program the fuses once each time you: Fit a new target device Change the device configuration (run from the internal clock, save EEPRO...
by TomasS
Fri Nov 06, 2009 12:43 pm
Forum: Bugs / Application Errors
Topic: Cannot Program via AVRISP MK2
Replies: 18
Views: 21952

Re: Cannot Program via AVRISP MK2

If you are using the STK500 programming option, the best way to set the device fuses is from AVR Studio. AVR Studio can be opened while Flowcode is running. When AVR Studio is connected to the programmer, the fuse settings are available under the 'Fuses' tab of the programmer panel. AVR Studio must...
by TomasS
Fri Nov 06, 2009 12:04 pm
Forum: Bugs / Application Errors
Topic: Cannot Program via AVRISP MK2
Replies: 18
Views: 21952

Re: Cannot Program via AVRISP MK2

Most newer devices (including the ATMEGA324P) have a CKDIV8 fuse that causes the clock frequency to be divided by 8. The devices are shipped with this option enabled. Our recommended fuse settings for an ATMEGA324P, running from an external 20MHz crystal, are for all options to be disabled (uncheck...
by TomasS
Fri Nov 06, 2009 12:02 pm
Forum: Bugs / Application Errors
Topic: Cannot Program via AVRISP MK2
Replies: 18
Views: 21952

Re: Cannot Program via AVRISP MK2

Benj wrote:Hello

It sounds like you have the internal divide by 8 configuration setting enabled.
I think you're right :)
I will try to look for it
by TomasS
Fri Nov 06, 2009 11:38 am
Forum: Bugs / Application Errors
Topic: Cannot Program via AVRISP MK2
Replies: 18
Views: 21952

Re: Cannot Program via AVRISP MK2

Hi Sean The ISP Frequency might be significant. 125KHz is a safe option for most configurations. This can also be checked and set from AVR Studio. If all this fails, it would be useful to try an replacement target device. Would this be a possibility? Success! Lowering the ISP Frequency to 125 kHz ac...
by TomasS
Fri Nov 06, 2009 9:51 am
Forum: Bugs / Application Errors
Topic: Cannot Program via AVRISP MK2
Replies: 18
Views: 21952

Re: Cannot Program via AVRISP MK2

Hi Sean! Communications with your AVR programmer seem to be working correctly using the STK500 option. All your parameters also appear to be correct from your screen shot. There should be no need to uninstall any drivers or applications. OK! The programmer indicates that it is erasing and re-program...
by TomasS
Sat Oct 31, 2009 8:36 pm
Forum: Bugs / Application Errors
Topic: Cannot Program via AVRISP MK2
Replies: 18
Views: 21952

Re: Cannot Program via AVRISP MK2

Hi Sean Hello Tomas It is likely that AVRDUDE is not able to locate the USB driver for the AVRISPmkII because the AVR Studio driver is being used. The recommended changes to the Location and Parameters settings only apply to the Programmer (Burner) values. The Compiler and Linker/Assembler settings ...
by TomasS
Wed Oct 28, 2009 4:36 pm
Forum: Bugs / Application Errors
Topic: Cannot Program via AVRISP MK2
Replies: 18
Views: 21952

Re: Cannot Program via AVRISP MK2

Hello This forum topic may help you to get up and running. http://www.matrixmultimedia.com/mmforums/viewtopic.php?f=5&t=5161&p=11060&hilit=AVRISP#p11055 Hi! A have a similar problem. I have bought Flowcode V3 for AVR together with an E-Blocks EB019 Board. I am able to simulate the flowchart I have ...