| QUOTE |
| You can use the bootloader or the AVR ISP cable. If you are going to use the ISP (In System Programming) header you can make a cable that connects to your parallel port for $1 probably. The ISP headers are the direct interface to the memory of the AtMega169. To use the the bootloader you need a serial cable (DB9 connector on one end). See the description in the user manual at http://www.atmel.com/dyn/resources/prod ... oc4271.pdf in section 3.7. The bootloader is pretty easy to use, as it is a program that runs on the Mega169 in a special section of memory, that loads the data into the application section. Using a bootloader you cannot change the bootloader section or fuses, which is good and bad. And you may already have a serial cable around which will work. Check the user manual section 2.4.1 where it talks about using the bootloader. |
| QUOTE |
| The Butterfly uses the internal oscillator as the processor clock, else has an external crystal 32.768khz for the RTC, On power up OSCCAL is adjusted to 1mhz using the external clock crystal , you may want to have a look at "OSCCAL_calibration()" function in the file "main.c". At 1 mhz only baudrate 2400, 4800 and 9600 are possible with and error of .2%, any other baud rate have a large error. with some manipulation (OSCCAL and prescaler) you may be able to get close to 1.8432mhz, this will give you any baud rate from 2400 to 230.4k. |
| QUOTE |
| If you use the calibration routine used in the Butterfly you can communicate from 2400, 4800 and 9600 bps only, the internal clock is adjusted to 1mhz; you need to modify the clock calibration routine for 1.8432 mhz for a better baud rate range ( 2400 to 230.4k). withouth calibration the internal oscillator it's not reliable enough for standard serial communication. Actually, the internal oscillator is adjusted to 8MHz. Then the prescaler is used to set the internal clock to 1MHz. For serial comms, the prescaler is changed temporarily so that the internal clock is set to 2MHz, which allows the 19200 baud rate to be used. |
| QUOTE |
| The memory is organized such that you get 8 additional bytes for every 256 bytes, this is common for NAND type flash devices. so think of it this way 8bits/byte * 256 bytes/page * 2048 pages = 4,194,304 bits = 4Mbit as a bonus you also get 8bits/byte * 8 bytes/page * 2048 pages = 32,768 bits = 32Kbit so the dataflash is really a 4Mbit+32Kbit device The addional 8 bytes arae typically used for wearlevel management and error correction codes for flash filesystems. |
| QUOTE |
| recently ordered a couple of different 4way + enter digital joypad's from both RS & farnell. For farnell try : 415-6225 - TPA511G 4 Way + Select 415-6249 - BTNTPA02-02(Clear) Button - TPA Hat (Both on page 433 of Book2 (2004 NZ catalogue)) For RS try : 336-7413 - SKQUCA - Multi-Fn Tactile (4 Way + Enter) (page 1083 in NZ 2003 RS Catalogue) |
| QUOTE |
| You can get it from RS-Components (www.rs-components.com). I tried the cst device and it worked well. It's also available at www.elfa.se. Part Nr. 35-665-44 |
| QUOTE |
| Yes! I've use 5 volts, from my programmator via programming connector. |
| QUOTE |
| It works with 5 volts |
| QUOTE |
| Yuo have JTAG enabled, that's why PORTF doesn't respond to OUT commands. Look at "Memory programming" in datasheet, you'll find fuses setings there. Diasble JTAG via SPI programmer and everything will be OK In Atmega169 datasheet. Look also chapter 2.4.3 in Butterfly datasheet. The only reason for PORTF not to respond is that JTAG is enabled. JTAG occupies pins 4-7 of PORTF. You have to clear JTAGEN and OCDEN fuses, this can be done thru ISP programmer. How to connect it, see Ch.3.2 Butterfly datasheet. |
| QUOTE |
| Could be the XP/NT problem of not being alowed to communicate directly with th e ports. You will need a seperate prog inther to enable that to happen. This has been covered several times on this forum with referances to software for overcoming this problem. If that is the problem |
| QUOTE |
| I run my STK500 on XP Pro without troubles. Haven't tried the JTAG ICE on it. But as with most RS-232 connections, the problem is most likely a reversed pin problem. One way to make sure you've got the right connection is to measure the voltage on pins 2 and 3 of your RS-232 connectors. One of them will have a voltage on it and one will not. Make sure that the connector you're plugging into has voltage on the OTHER pin. That is, if the PC is driving pin 2, make sure pin 2 on the device you're connecting it to does not have any voltage on it, and make sure pin 3 DOES. On a DB-9 connector, I believe ground is pin 5. On a DB-25, it is pin 7. Nine times out of ten, this is the problem. If you find that your connectors don't match, add a "NULL MODEM" adapter (available at Radio Shack) to one end of the cable. Baud rate is another thing to check, although I think the program should be setting that up for you. Inability to detect the device is almost certainly a connection or baud rate problem. Could also be a power problem. Make sure you have power applied. |
| QUOTE |
| According to the data sheet, the 169 can employ "double-speed" clocking to the USART. This could be what Atmel is refering to, and not the MCU clk speed. |
| QUOTE |
| No answer to the initial question but an attempt to clear things up a little bit: The Butterfly is clocked by the internal RC (8Mhz) which is devided by 8 by default to a 1MHz clock-freqency. This interal RC is calibrated during startup (OSCAL) with the on-board 32kHz clock-crystal which is used for the RTC in the first place in the preinstalled application. Main reason for this calibration may be getting the UART-Timing more precise. To get 19200 baud with a low error the divider is first changed to 4 (CLKPR) which results in a system-clock of 2MHz. Baud rate is set to 9600 and the UART is set to double speed which results to 19200 baud at 0,2% error. See also the source-code of the Butterfly-bootloader. Overclocked or not, it is a good idea to keep the default at 8/8 Mhz to save battery-power and "boost" only if needed. |
| QUOTE |
| None of the AVR's can do RS232 directly. If you look on page 4 of the butterfly schematic you'll see the level translators that were used. |
| QUOTE |
| Yep, there sure is a need for someone to take chips like the 169 and 128, those high preformers that are not DIP format, design a board, have just that chip put one in, with places to connect an LCD like the ButterFly has and other 4 pin LCD plus bring out all the other ports to headers., place for a xtal and a RS232 I/O chip. Keep it really inexpensive by having only the micro itself on the PCB. The end user can add what they need. |
| QUOTE |
| The whole point with the m169 is that it features a LCD CONTROLLER and hence each LCD segment must be multiplexed using several IOs for line and coloumn select. If you wan't to acess the LCD with a 4 bit interface the LCD itself must contain an LCD controller and the entire point of having an LCD controller inside the m169 falls apart That's why so many IO pins are used to drive the display. |
| QUOTE |
| It sounds like a do-able project (actually I have thought about making something similar). I wouldn't bother with the Butterfly - you will not be using enough of its features to make it worthwhile. Instead use an AtMega16 controller - that will be pretty much all you need!! It has 8 ADC inputs, lots of digital outputs, and other fun stuff. For software tools you will pretty much have to use avr-gcc, which is quite good! There is a windows distribution of it (WinAVR), but in your case just compile them for linux. See the avr-libc documention - it talks about installing in Linux I think (google for avr-libc, hit HTML documention, then goto "Others" or "FAQ" section or something like that). To make this easier to start out get an STK500 - it takes care of all the hardware requirements. Then you can later move over to a custom circuit board. For control of the thing just use a normal serial port, a lot of motherboards have an extra COM port connector internally (10-pin header) you could plug into. Otherwise use an FTDI Chip to make a simple USB --> Serial converter. This way it will be useful under any OS. You will need some MOSFET devices or something like that for the actual fan power control. Check out http://www.maxim-ic.com/appnotes.cfm/appnote_number/707 for some info on the fans and controlling them. |
| QUOTE |
| The butterfly would work if you end up using digital sensors. The reason I didn't recommend it was that the only way to get some analog inputs is to disable the JTAG interface, even then it only gives you four inputs. The butterfly does have one on-board temperature sensor though, could be case temp or something. See http://www.atmel.com/dyn/resources/prod_do...nts/doc4249.pdf for quick guide to Butterfly, and http://www.atmel.com/dyn/resources/prod_do...nts/doc2514.pdf for the AtMega169 datasheet. |
| QUOTE |
| I don't think that you would find one wire support on anything other than Dallas' range of microcontrollers. But if you want to avoid all this, why not use some thermistors and the Mega's ADC inputs? Use the thermistors as part of a resistor paralell/ serial network and they should demonstrate a reasonably linear characteristic. If you only need it to be accurate to within a couple of degrees this should be quite acceptable. I have not looked at the PC component market for a while. But I seem to remember these type of fan controllers being fairly costly, considering what they actually do. Seems like you have yourself an interesting project here! Perhaps with some commercial potential too! |
| QUOTE |
| Try to find a STK500-owner near you and try prarallel-programming. It's described in the Butterfly user-guide. With par.-prog. you should be able to reset the fuses to delivery-state. |
| QUOTE |
| Maybe the ISP-Pins (MISO/MOSI). Keep the the dataflash in mind which is connected to the SPI-interface (control the DF chip-select pin). You may also disable the JTAG interface (JTAGEN fuse or JTD-bit in MCUCR) and then use the 4-JTAG-pins as "general I/O". |
| QUOTE |
| I tried this and at first it didn't work. Closer examination of the data sheet showed that the same data has to be presented within 4 machine cycles to be effective. I guess it's some sort of safety feature. I ended up making sure by doing it four times in a row, and it works fine. In avr-gcc, MCUCR |= (1<<JTD); //settting jtag disable to use pf4-7 as i/o MCUCR |= (1<<JTD); MCUCR |= (1<<JTD); MCUCR |= (1<<JTD); See page 236 of the complete ATMega169 data sheet. Incidentally, the .lss file from the compiler shows that the machine code that is compiled is 4f0: 85 b7 in r24, 0x35 4f2: 80 68 ori r24, 0x80 4f4: 85 bf out 0x35, r24 and that is repeated 4 times. I'm posting it in case you aren't using a C compiler. |
| QUOTE |
| The "four cycles" method is used to manipulate a number of subsystems--watchdog timer, SPM, vector select, etc. Search the datasheet for "four cycles". |
| QUOTE |
To ensure the "within four cycles" criterion, do the sequence when global interrupts are disabled. This could be during your system startup or bracket the sequence with CLI/SEI as with other operations that need to be monolithic. It seems to me that the paragraph on the JTD bit of MCUCR is fairly straightforward, and is quickly found with a datasheet search for "JTD". |