Program At90s2313 With Arduino Software

31 views
Skip to first unread message

Wesley Dupler

unread,
May 6, 2024, 6:19:08 AM5/6/24
to agituldi

Well, it looks like AT90S2313 is essentially identical to ATtiny2313, so you might get away with just using the existing ATtiny2313 settings. (Check the fuses, though. Or program them from outside the IDE.) If you must, you can modify the "chip" sub-menu of the attinyx313 entry in the ATtinyCore boards.txt:

PS: Why?
If you've got significant stock of AT90S series parts, you can probably find some commercial manufacturer who "needs" them and will pay more for them than it would cost you to buy a new and better parts. (Hmm. Not counting global chip shortages ) A chip with only 2k of program memory and essentially no peripherals is barely worth using Arduino functions.

Program at90s2313 with arduino software


Download Ziphttps://t.co/ltxDyZGr6V



Oh boy, I am sorry about the errors on the part numbers. I have the following Micro's, AT90S2313, AT90S2323, AT90S4414, AT90S8515, and the AT90S8535. They are all old stock and I don't think Atmel even makes them anymore. I bought them a while back, thinking that I would learn to program them and then I had a stroke. It has been three years since and I got the interest back up to see if I could learn to use them. While on the web, I see the Arduino and that really sparked my interest again. I am going to order a Arduino next month when I get some money saved up but in the mean while I was wondering about these Micro's that I have. I don't know whether the Arduino language which is a derivative of C. ( I think), would work with the older chips or not.

What Coding Badly meant was that was incorrect and that a bootloader is not necessary to use the Arduino IDE
as the IDE can simply use a programmer that uses ISP instead of a serial bootloader.
And by using the ISP with an ISP programmer any work of getting a bootloader to work
on the new hardware would be eliminated.
Configuring the IDE for new boards or programmers is trivial in comparison
to getting a bootloader up and working.

Keep in mind that if support of AVRs not included with the Arduino distribution is needed,
then something has to be done to get the "unsupported" boards supported on each new Arduino release.
And what is done to make that happen will be the same whether you use a serial bootloader or use ISP to program the AVR.
(but that becomes a one time thing if the users sketches/hardware directory is used to add the hardware support)

So if the users sketches/hardware directory is used to add the new hardware support
and it used one of the supported ISP programmers above,
adding support for a new AVR without whether using a serial bootloader or
ISP is a one time thing.

For the former, it looks like you'd use the SPI bus to communicate between the Arduino's ATMega and your circuit's At90s2313, but you'd have to look at the At90s2313's programming to see how you communicate with it.

Do not bother with anything BUT in-circuit programming. Unless you are a perfect coder, removing a chip every time you want to program it is a nightmare. I recommend the AVRISPmkII as an entry level programming tool. The disadvantage is there is no hardware debug supported. An alternative is the dragon but I have no experience with that. I can say that the JTAGICEmk3 is a nice capable debug tool.

To start, I kept using an Arduino but converted calls to the Arduino library into register reads and writes, one line at a time, seeing if my programs still worked. This way I got used to using registers and saw that they were not radically discontinuous with the Arduino way of doing things. Arduino functions like digitalWrite() simply manipulate the registers -- you are free to read and write to them directly in your sketches.

My next step was to put an ATTiny 85 on a breadboard and program it with Arduino as ISP ( =1695). If you buy a breadboard power supply and use the ATTiny's internal oscillator, this requires laughably little wiring. I used the Arduino IDE to compile but kept using registers as much as I could.

Then, I installed the free Crosspack command line toolchain and compiled a blinky program. After some more trial and error, I managed to program the ATTiny with avrdude only, staying completely outside the Arudino ecosystem.

The difference between an Arduino and a bare ATmega328 is only two things. The Arduino Bootloader, and the Arduino libraries. You can code an Arduino with bare C or C++ without using any of the libraries. You can also use assembly instead. The bootloader allows you to load new code through serial without going through the (slightly) more complicated in-circuit-serial-programming (basically SPI).

You can use standard programming libraries and avr-gcc with almost any ide. Contrary to what others might say, coding an Arduino is basically like coding a bare microcontroller, with some added conveniences at the expense of some performance.

I buy pre-bootloaded Atmega328P chips and program them in-circuit with an FTDI cable and avrdude, identically to how I'd program the Arduino. I like the Eclipse IDE but you can use any environment you prefer - Atmel Studio, the Arduino IDE, emacs, or barefoot on the command-line.

This board is under construction at the point where it is complete enough to test with a Hello program, using the cable for programming, power, and terminal. It will still need its power supply - LM2936 ultra-low quiescient current voltage regulator and a battery connector, in my case - and whatever other on-board components and off-board connections the project will need:

Since you have an Arduino, you could save a little money and use un-programmed chips, using the Arduino to install the bootloader.The nice blue pin-out labels help keep my goof-rate down!I use a 16MHz crystal but if you can run with the internal oscillator your parts count goes down by 3 (the xtal and 2 capacitors).

You can use the Arduino board, without using the sandbox libraries and environment, you can program everything yourself directly. If you want to use their bootloader via serial/uart to program, that works fine. But most/all the avr parts can also be programmed another way, with the part held in reset which means it is not brickable. it is quite easy to bit bang spi from an arduino or other microcontroller or with an ftdi break out of some flavor. sparkfun has arduino and non-arduino boards (the 32u for example) that the spi header is obvious. and ftdi breakout boards that you can easily bitbang using ftdi's library or the ftdi library that comes with linux.

The documentation for each part shows the booting options and flash programming options. yes it is not difficult to just buy some parts too and make your own breakout board. I wouldnt do that until you have used an existing breakout or simple eval board and then clone that if need be. Ideally start with a part with an internal rc oscillator, basically power, ground, and programming pins...

The scenario for which I'm considering is if I were to install an arduino (permanently) in a location that is remote from my computer (I don't have a laptop nor do I want to get one) it would be troublesome to reprogram it.

Also, after crystal, reset, VCC and ground pins the only ones left are the three used by 6-pin programing header (SCK/MOSI/MISO lines), so you need to use them for both programming and USB lines / LED. Should not be a big problem as both USB lines and LED have series resistors. Should there be a problem with programming or USB operation, you can of course first detach USB, attach the programmer, and after flashing, detach the programmer and re-attach USB. :)

I tried to disable my programmer to power the target board by simply not connecting the power from my usbasp programmer and rather connected the power from the usb connector. When you meant to disable the power to the target from the programmer I assume it should ideally be a jumper setting in the programmer to do that right? Unfortunately my programmer does not have anything like that. Hence I decided not to connect it at all from my programmer. Now when I try programming my device with the power derived from the usb cable but not from the programmer it is inconsistent. The errors I see are,

The in-system programming (ISP) programming method is functionally performed through SPI, plus some twiddling of the Reset line. As long as the SPI pins of the AVR are not connected to anything disruptive, the AVR chip can stay soldered on a PCB while reprogramming. All that is needed is a 6-pin connector and programming adapter. This is the most common way to develop with an AVR.

The Unified Program and Debug Interface (UPDI) is a one-wire interface for external programming and on-chip debugging of newer ATtiny and ATmega devices. The Atmel-ICE and PICkit 4 are capable of programming UPDI chips. It is also possible to use an Arduino thanks to jtag2updi,[19] or a standard USB-UART adapter with the TX and RX pin shorted by a 1 kΩ resistor and the pymcuprog utility provided by Microchip.[20]

The AT90SC series of AVRs are available with a factory mask-ROM rather than flash for program memory.[26] Because of the large up-front cost and minimum order quantity, a mask-ROM is only cost-effective for high-production runs.

The STK500 starter kit and development system features ISP and high voltage programming (HVP) for all AVR devices, either directly or through extension boards. The board is fitted with DIP sockets for all AVRs available in DIP packages.

The STK200 starter kit and development system has a DIP socket that can host an AVR chip in a 40, 20, or 8-pin package. The board has a 4 MHz clock source, 8 light-emitting diode (LED)s, 8 input buttons, an RS-232 port, a socket for a 32 KB SRAM and numerous general I/O. The chip can be programmed with a dongle connected to the parallel port.

As the AVRISP mkII lacks driver/buffer ICs,[36] it can have trouble programming target boards with multiple loads on its SPI lines. In such occurrences, a programmer capable of sourcing greater current is required. Alternatively, the AVRISP mkII can still be used if low-value (150 ohm) load-limiting resistors can be placed on the SPI lines before each peripheral device.

e2b47a7662
Reply all
Reply to author
Forward
0 new messages