Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 06:52 28 Nov 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : And now for something completely different - coming soon

Author Message
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9129
Posted: 10:07pm 24 Jul 2023
Copy link to clipboard 
Print this post

TinyBasic on the ATTiny85
including digital read/write, analog read/write, DS18B20 support and tones.
Program can be save in the in-built EEPROM and run on power-up
All implemented in  8K flash and 512 bytes of RAM and EEPROM





 
Plasmamac

Guru

Joined: 31/01/2019
Location: Germany
Posts: 554
Posted: 11:00pm 24 Jul 2023
Copy link to clipboard 
Print this post

lol i must test this
Plasma
 
NPHighview

Senior Member

Joined: 02/09/2020
Location: United States
Posts: 200
Posted: 11:44pm 24 Jul 2023
Copy link to clipboard 
Print this post

I've got my Uno and ATTiny85 Arduino programming shield sitting right here. I suspect, however, that's not the way you're going to have us do this :-)


Edited 2023-07-25 09:45 by NPHighview
Live in the Future. It's Just Starting Now!
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9308
Posted: 12:47am 25 Jul 2023
Copy link to clipboard 
Print this post

Looks like we might have a challenger to the 8-pin PICAXE chip.
Watching this thread with interest.  
Smoke makes things work. When the smoke gets out, it stops!
 
Rickard5

Guru

Joined: 31/03/2022
Location: United States
Posts: 463
Posted: 01:35am 25 Jul 2023
Copy link to clipboard 
Print this post

UMM SOO VERRY COOL matherp, But can I request the addition off a command for servos or Stepper control PLEASE
I may be Vulgar, but , while I'm poor, I'm Industrious, Honest,  and trustworthy! I Know my Place
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9308
Posted: 05:01am 25 Jul 2023
Copy link to clipboard 
Print this post

Which flavour/speed of tiny85 can you use?
Any of them?
Most of these are out-of-stock due to the ongoing chip shortages.

If you are willing to use QFN package, they have plenty(several thousand), but most of the SOIC and DIL packages are out of stock till October 2024!

The usual story.....

The DIL version shows 11 chips available from the 27th(they'll get gobbled up pretty quick I would say), then no more DIL till the above October 2024 date.

Microchip Direct Link...

4000 SOIJ package available from early next month.

Perhaps Peter has another source for the chips he got he would like to share.  
Smoke makes things work. When the smoke gets out, it stops!
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4247
Posted: 05:19am 25 Jul 2023
Copy link to clipboard 
Print this post

You all must be aware , .and have forgotten about it.
But Tinybasic is , TINY.
Only 26 integer variables (16 bit) and no strings.
And with 280 bytes free your programs are small.

I have tinybasic on UNO, with 900 bytes RAM and even then, it is a challenge.
It will just hold the 4 squares program.

Nice for a programming Challenge through, and as a statement that it can be done.

PICAXE 08M2 is in a different league.

Volhout

Peter: you can use program memory better if you allow to abbreviate commands ( they are stored in ascii). In the command parser, add 2 lines that allows to use the abbreviation with a ".". So PRINT becomes P. and DREAD becomes DR. The dot alse is terminator, so you can skip the trailin whitespace.
Edited 2023-07-25 15:28 by Volhout
PicomiteVGA PETSCII ROBOTS
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9308
Posted: 05:30am 25 Jul 2023
Copy link to clipboard 
Print this post

The first PICAXE 08A chip only had 128 bytes of memory for your program.  
I am pretty sure that the next model up, they dropped the "A", and the standard PICAXE 08 chip then had 256 bytes of program memory.

TinyBasic still has more then that if you have 280 bytes to play with!    
Smoke makes things work. When the smoke gets out, it stops!
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 6798
Posted: 06:15am 25 Jul 2023
Copy link to clipboard 
Print this post

Farnell are showing ATTiny85-20PU (20MHz 8k 8-DIL) as 26,333 in stock. It might take us a week or two to put a dent in that.

1.644 UKP each incl. VAT.

Eeeeh.... I remember Li Chen Wang's Palo Alto Tiny BASIC! :)  It was the first BASIC I ever used. Well, a version of it anyway.

10 F.I-1TO10
20 P.I*I
30 N.I

Might have been how I'd have written it at the time. Every byte was precious so there were no spaces or comments unless you *really* needed them. :)

I wonder if this supports the (one and only) array @() which is automatically dimensioned to use all the spare memory?
Edited 2023-07-25 16:21 by Mixtel90
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4247
Posted: 06:39am 25 Jul 2023
Copy link to clipboard 
Print this post

  Grogster said  the standard PICAXE 08 chip then had 256 bytes of program memory.

TinyBasic still has more then that if you have 280 bytes to play with!    


Not sure about the efficiency of the PICAXE pre-compiler. If we could "tokenize" tinybasic program you may be right. But the standard tinybasic interpreter stores the code like this:

- 2 bytes (16 bit hex line number)
- the whole line in ASSCII characters
- <CR>

Tokenizing would translate "PRINT" in a single byte code.

I see use for TINY85 as a peripheral to a larger mite. If it has PWM (analog write ?) you could do this

10 A=AREAD(2)
20 AWRITE 3,A
30 DELAY 1
40 GOTO 10

This would translate an anlog (ADC) voltage into a PWM signal that could be passed through a standard opto coupler to make an isolated analog input to CMM2 or PICO (i.e. measure mains voltage safely).
Smart peripheral...

Volhout
PicomiteVGA PETSCII ROBOTS
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4247
Posted: 06:40am 25 Jul 2023
Copy link to clipboard 
Print this post

  Grogster said  the standard PICAXE 08 chip then had 256 bytes of program memory.

TinyBasic still has more then that if you have 280 bytes to play with!    


Not sure about the efficiency of the PICAXE pre-compiler. If we could "tokenize" tinybasic program you may be right. But the standard tinybasic interpreter stores the code like this:

- 2 bytes (16 bit hex line number)
- the whole line in ASSCII characters
- <CR>

Tokenizing would translate "PRINT" in a single byte code.

I see use for TINY85 as a peripheral to a larger mite. If it has PWM (analog write ?) you could do this

10 A=AREAD(2)
20 AWRITE 3,A
30 DELAY 1
40 GOTO 10

This would translate an anlog (ADC) voltage into a PWM signal that could be passed through a standard opto coupler to make an isolated analog input to CMM2 or PICO (i.e. measure mains voltage safely).
Smart peripheral...

Volhout

P.S. remember one thing... there is no edit function in tinybasic. Just retype the whole line. Or develop in notepad, and paste the program in your terminal...
Edited 2023-07-25 16:41 by Volhout
PicomiteVGA PETSCII ROBOTS
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 6798
Posted: 07:33am 25 Jul 2023
Copy link to clipboard 
Print this post

I had to retype lines (under NASBUG and T4. NasSys handled editing much better). It's not much of a pain as you can only have one statement per line so they are rarely long.

These things are more of a 555-Turbo but without the high current output stage. About 3x the cost of a NE555 and fit the same socket, but rather more versatile.  :)
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
NPHighview

Senior Member

Joined: 02/09/2020
Location: United States
Posts: 200
Posted: 01:51pm 25 Jul 2023
Copy link to clipboard 
Print this post

Mixtel90:
  Quote  These things are more of a 555-Turbo but without the high current output stage. About 3x the cost of a NE555 and fit the same socket, but rather more versatile.  :)


A friend made a line of toys that used hand-soldered 555 or 556 circuits, along with capacitors, resistors, photoresistors, LEDs, and tiny, tinny speakers. Each assembly took an hour or more of intricate soldering.

I programmed (in Arduino) all of the functionality of all of his toys into a single ATTiny85 (getting all of it into 5 or 6 i/o pins was a challenge), provided him with an Uno, a programming shield, and a tube of 85's, all to no avail. I guess he was so set in his ways that he couldn't conceive of doing it any other way.

Oh, well.
Live in the Future. It's Just Starting Now!
 
Bill.b

Senior Member

Joined: 25/06/2011
Location: Australia
Posts: 226
Posted: 12:25am 26 Jul 2023
Copy link to clipboard 
Print this post

The picaxe 08M2 now has 2048 bytes of program memory and 128 bytes of ram

Bill
In the interests of the environment, this post has been constructed entirely from recycled electrons.
 
Quazee137

Guru

Joined: 07/08/2016
Location: United States
Posts: 571
Posted: 02:15am 26 Jul 2023
Copy link to clipboard 
Print this post

Seeing this I went and rechecked a big box from a friend that did STEM for kids
 after school. Sadly he passed away and family thought I'd make use of it all.

 A few tubes of ATTY85 and ATTY84 a sub-box of 20 or so blue pills and what
 may be black pills too. Over 50 nano's and a few with a USB pcb that plugs in.
 16 channel PWM boards, motor controllers so much more even motors too.
 Also a bunch of ESP32 boards I didn't see first time I look i the box.

 Many variations of Arduino's. I've played a bit with some just following a
 few youtube/online projects.

 What basic's are good to have a play with on the mix of chips/boards.

 A FUN find is a few BASIC-STAMP boards.

 Quazee137
 
 I will need to make time to explore all this now.
Edited 2023-07-26 12:17 by Quazee137
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4247
Posted: 12:59pm 26 Jul 2023
Copy link to clipboard 
Print this post

Hi Quazee,

It should be obvious that you are appointed to continue the STEM activities.
With all these materials it would be a waste if they would not benefit the kids.

Take the box, visit the nearest school, and offer your services.
I bet you are great at it, and with the help of this forum you can't go wrong..

Volhout
PicomiteVGA PETSCII ROBOTS
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024