Re: It’s Here! Half-Byte Tiny Basic 2 For Arduino And compatibles

0 views
Skip to first unread message
Message has been deleted

Christal Rasband

unread,
Jul 10, 2024, 6:42:34 AM7/10/24
to xidenone

OK, so I bought the Nano Every 3 packs and downloaded the new IDE to be able to use it, etc, etc. and it /seems/ to be getting further. the updated master code uploaded just fine, but the GPU is giving me this error now.

exit status 1
Compilation error: no matching function for call to 'RasterPort::begin(const char [1024], uchar [1150], int, int, int, int, int)'


and this is the bit of highlighted code from the editor... the section right above it in the if statement seems to pass the compiler fine, so maybe there's a typo? last time I wrote code was casio basic lol.

Screen.begin(textfont,asciibuf, 25*8,46,22,20,1);

PS, thank you for being patient with me

The updated firmware for the computer can be found here:


The new changes include the backspace fix, the bug fix in the "FILES" command, and the first cut of the PLAY command inspired by MSX BASIC and QBASIC (see the screenshot).

Please note, that to take advantage of the extended features, you would have to upgrade the "primary" Arduino Nano with Arduino Nano Every. The latter has the same pinout.

When ENABLE_TONES is defined, the sketch includes the tiny "play" library that can be found here:

Its Here! Half-Byte Tiny Basic 2 For Arduino And compatibles


Download https://ssurll.com/2yXIPD



I changed the type of the variable to byte, as you don't need a whole int (16 bits) for a simple flag. So I used the smallest variable type, a byte. (you could also use boolean here, but basically that's the same)

I read this question a few months back, having exactly the same issue, and didn't really find anything efficient enough for a tiny 8-bit micro with tiny amounts of RAM. So inspired by CAN and LIN I built something to do the job. I called it MIN (Microcontroller Interconnect Network) and I've uploaded it to GitHub here:

Storage is provided via cartridges; each contains a typical SPI EEPROM or FeRAM (the only restriction being that they have to be 3.3 volts and support the same basic read/write operations built into the kernel). There's no filesystem as despite the modern-day technology used, the inspiration was more from the era of tape storage (or at best the stringy floppy); where back in the day you'd record the values on a tape counter, here you just specify the starting page in the EEPROM, and kernel code and Basic commands take care of the rest; a virtual "head" is positioned using a SEEK command, LOAD and SAVE commands save starting at the current location, and the HEAD command tells you the current page and device.

Anyway, as far as the circuit, here's a brief explanation. The Propeller basically drives the CPU and most of the circuit with the help of a '541 buffer to alternate between data and address lines on the bus; the technique is very similar to Dennis Ferron's project and Goudsmit's Propeddle project, just far simpler as it needs to do less. The Propeller generates the phi clock for the 65C02, handles address decoding for other chips, and also acts as a video chip, sound chip, UART, and ROM mapped to the top 16K of the 6502's address range:

The rest of the board is more or less a traditional 65C02/65C22 circuit with a static RAM (more below), all running at 3.3V to keep things simple:

The 65C22 provides most of the I/O exposed on the expansion port and also handles keyboard/joystick decoding with the help of a 4051 (a trick I learned from Garth Wilson's website many years ago, itself discussing how the Oric handled keyboard scanning):

The end result is kind of a "Commodore 64 Junior" in terms of capability, but philosophically it's more like the Commodore Plus/4. The Commodore Plus/4 was basically a 6502 computer built around the TED chip to keep things simple and cheap. For the Cody Computer, the Propeller serves the same basic function, it's just that the dedicated "hardware" is mostly implemented in PASM.

This tiny little board does all of the neat-o Arduino tricks that you're familiar with: 9 channels of 10-bit ADC, 5 PWM pins, 12 DIOs as well as hardware serial connections Rx and Tx. Running at 16MHz and 5V, this board will remind you a lot of your other favorite Arduino-compatible boards but this little guy can go just about anywhere. There is a voltage regulator on board so it can accept voltage up to 12VDC. If you're supplying unregulated power to the board, be sure to connect to the "RAW" pin on not VCC.

For anyone working with windows 8/8.1 here is how I got it to work:

  1. Enable installation of unsigned drivers: 8.1 or 8
  2. Once signing is disabled uninstall and re-install the arduino IDE (version 1.0.5)
  3. Open device manager
  4. Get the windows drivers from the tutorial
  5. Reset the board twice quick succession as described under Reset Bootloader
  6. Notice the windows sound signalling a new device being recognized. The new device should show up in device manager with the orange triangle as the pro micro.
  7. Install the driver as described in the tutorial for windows installation for this new device that showed up. I had to reset the board a couple of times during navigation to the driver and then just as I was clicking the button to install the driver. It finished before I heard the sound signalling removal of a device.
  8. Upload sketches to the regular com port that is under device manager, and during upload the pro micro will show up briefly in device manager with the driver you just installed, and disappear, and the sketch should work.

A basic compiler for avr chips was written many years ago and works great if someone would fix it where it would port directly to the ard kits. As it is you can still write your program in basic and send to the atmel chip isp. It is called Bascom avr. If you can find a copy I could zip it up for you as I bought it many years ago. It still runs under windows 7, xp or 98. stx3...@gmail.com

Ill say go for the BASIC, if there is someone who cant know where the goto goes thats their problem, time will tell who wins a dificult language like lua, c, arduino sketch or Basic, arduiino is the first eazy plataform for electronics but is tied-up with a C-like programing, now if we change that to an easy one like Basic its going to grow Viral

Excellent tutorial.
How can i communicate more then two Arduinos using NRf24L01. I am working on a project where i have LCD with each arduinos and there is no concept of master-slave in it. for example. Arduino A send message to arduino B and C and display that message on B and C LCD. and then B or C reply to A And A show the message on LCD.
This project is based on consensus control of multi-agent systems where every agent is responsible to control its own resources.

Step 1: Install the DIO2 library as any other Arduino library, that is extract the downloaded files into you Arduino libraries folder or use the automatic library install from the Arduino drop-down menu Sketch > Import Library.
Note that the automatic library install will install the library into your user profile only; into the Documents\Arduino\libraries folder (at least this is where I found it on my Win7 computer).

Step 2: Copy the pin2_arduino.h file for the board(s) you plan to use into the appropriate folder in your Arduino location.
You will find this file in the attached zip file (or in the extracted library folder) in [zip file]\board\[board], where [board] is standard for Arduino Uno and mega for Arduino Mega.
This destination folder is:

How it works? There is an array defined in pins2_arduino.h file which contains the pin codes for pins available in given board. When you call e.g. digitalWrite2, it will convert the pin number into its pin code using this array and then call the native digitalWrite2f with this pin code. Of course, this conversion takes some time, but the functions are still faster than the original Arduino ones.

If you decide to use the I/O 2 functions on other Arduino board than the Uno or Mega, you will have to create your on version of the pin2_arduino.h file with the pin codes. This is relatively easy task. I would say easier than creating the various arrays needed for standard Arduino digital I/O. You just define the enum GPIO_pin_enum with pin codes appropriate for your board and the gpio_pins_progmem array, which maps these pin codes to the pin number. There should be no changes needed in the other parts of the code. For detailed instructions, please see the comments in the provided pins2_arduino.h files.

The basic presumption for all the methods is, that there must be simple interface for the user, such as digitalWrite(pin, value). This leads to task of somehow converting the 'pin' parameter into appropriate port register and bit mask for the given pin and then reading/writing to the register using the bit mask.

Now that we have the physical connections ready, we need the software. You can download our example code for the ATmega168 is here (5 kB .ZIP file), and the code example for the ATtiny2313 is here (5 kB .ZIP file).

ATtiny3217 is a modern AVR microcontroller chip from Microchip that could potentially replace ATmega328p that is widely used in official Arduino boards, and here is how I build an Arduino compatible development board based on ATtiny3217.

ATtiny3217 is a 24-pin MCU, yet it offers the same amount of flash memory and SRAM as ATmega328p, the only memory that is less than the ATMega328p is the EEPROM which has only 256 bytes compare to 1024 bytes in ATmega328p. The total programmable I/O pins of 22 is also almost the same as ATmega328p's 23 programmable I/O pins. Both MCUs have the same hardware UART, SPI and I2C port. The similarity end there, ATtiny3217 has 2 ADC, each with 12 channels of 8-bit ADC, versus ATmega328p of one ADC with 8 channels of 10-bit ADC. In terms of PWM capable channels, ATtiny3217 offers 8 PWM channels while only 6 pins are configurable for PWM in ATmega328p.

ATmega328p doesn't have any DAC while ATtiny3217 offers 3 8-bit DAC channels. Configurable Custom Logic/Lookup Table is an interesting feature, let's say you are designing a circuit and you realised that you would need a flip-flop circuitry, instead of rushing to your component store to get a flip-flop IC, you could configure a flip-flop within ATtiny3217. ATtiny3217 offers more timers with 16-bit, it also has a 16-bit build-in real-time clock derived from the interal clock source. Another powerful feature is the event system channel that allows you to tie the output of one event to trigger the input of another channel without involved CPU process. All the modern MCUs release in the past 10 years or so comes with Periperral Touch Controller, and there is no except for ATtiny3217. Five configurable interval voltage references make the measurement of analog input easier and potential save the needs of having an external voltage regulator chip in case you need a reference voltage, say, 1.1v.

aa06259810
Reply all
Reply to author
Forward
0 new messages