Author Topic: AVR BASIC Computer....  (Read 7134 times)

0 Members and 1 Guest are viewing this topic.

Offline KilroywashereTopic starter

  • Regular Contributor
  • *
  • Posts: 112
  • Country: ca
  • He has the stink of oil and electric circuitry...
AVR BASIC Computer....
« on: April 04, 2019, 12:19:49 am »
Hey

      Been trying to get this to run for some time now, I have been messing around with the code and trying to fix it but its beyond my skill level.

https://www.instructables.com/id/Single-Chip-AVR-BASIC-Computer/


Im told the latest is https://github.com/fuzzymannerz/AVR-BASIC-Computer



I guess what i want to know is anyone get this to work ? and what did they do ... so i can do the same ....


I had was thinking get tiny basic ( https://github.com/BleuLlama/TinyBasicPlus )  and try to put the tvout and ps2keybord on this .....



Honestly i want to do this basic computer so bad...... and i dont think my skill level is quite there .....


i really need  to know what to do....  somehow i think im not doing something right.... I tryed to fix the code  spieeprom.h and sepieeprom.cpp and open it in notepad++ .....look for #include <WProgram.h>  and change it to

#include <Arduino.h>


than i got this one ----------------------------------------------------------------------------------------------

AVR_BASIC_Computer_V0.1:309:33: error: variable 'keywords' must be const in order to be put into read-only section by means of '__attribute__((progmem))'

 static unsigned char keywords[] PROGMEM = {

Tryed  to fix with this code-----------------------------------------------------------------

 static const unsigned char keywords[] PROGMEM = {
-----------------------------------------------------------------------------------------------------------



Anyway .... i really need help has anyone gotten this to work for them ?   can i download an older ide or something?????


I know its asking alot  ....... but i cant stop thinking about this basic computer .....    anyone know of an update or a better way to do this???


this is the latest one i found https://hackaday.io/project/3537/instructions and i think people are having the same issues as me.....
« Last Edit: April 04, 2019, 12:46:24 am by Kilroywashere »
He is part of the dead...he has no place here. He has the stink of oil and electric circuitry about him. He is obsolete...
 

Offline hamster_nz

  • Super Contributor
  • ***
  • Posts: 2819
  • Country: nz
Re: AVR BASIC Computer....
« Reply #1 on: April 04, 2019, 01:00:35 am »
Hi,

As the original author of the TinyBASIC for Arduino port, that Scott extended and eventually became this, I guess this falls in my lap...

As time has gone on I think the Arduino C compilers have become more and more picky about things, and code that used to work is now broken. It shouldn't be too hard to get the S/W working again.

It looks like in this case all you need is the "const" keyword to allow the "keywords" array to be stored in flash rather than RAM. If you PM me we can work on this together...

Gaze not into the abyss, lest you become recognized as an abyss domain expert, and they expect you keep gazing into the damn thing.
 

Offline iMo

  • Super Contributor
  • ***
  • Posts: 5661
  • Country: gw
Re: AVR BASIC Computer....
« Reply #2 on: April 04, 2019, 06:02:04 am »
Why do you start a second thread with the same issues?

https://www.eevblog.com/forum/microcontrollers/atmega1284-programming-issues/msg2316555/#msg2316555

The issues you have got are standard one. Also mind the atmega1284 is not supported by Arduino company, afaik. Moreover there is the https://forum.arduino.cc/ you may ask too.

« Last Edit: April 04, 2019, 06:12:02 am by imo »
Readers discretion is advised..
 
The following users thanked this post: agehall

Offline KilroywashereTopic starter

  • Regular Contributor
  • *
  • Posts: 112
  • Country: ca
  • He has the stink of oil and electric circuitry...
Re: AVR BASIC Computer....
« Reply #3 on: April 04, 2019, 07:20:16 am »
Why do you start a second thread with the same issues?

https://www.eevblog.com/forum/microcontrollers/atmega1284-programming-issues/msg2316555/#msg2316555

The issues you have got are standard one. Also mind the atmega1284 is not supported by Arduino company, afaik. Moreover there is the https://forum.arduino.cc/ you may ask too.



I am sorry for the new post  but this one was to see if anyone had it working and in the old one i was thinking it was something to do with the board manager .....   
Im sorry if it seemed like i spammed this topic .... I just really want this to work ....

i have also been on arduino fourms asking if anyone had got it to work with no luck but some people have had the same issues as me i guess...


 
« Last Edit: April 04, 2019, 07:32:04 am by Kilroywashere »
He is part of the dead...he has no place here. He has the stink of oil and electric circuitry about him. He is obsolete...
 

Offline KilroywashereTopic starter

  • Regular Contributor
  • *
  • Posts: 112
  • Country: ca
  • He has the stink of oil and electric circuitry...
Re: AVR BASIC Computer....
« Reply #4 on: April 04, 2019, 07:36:33 am »
Im sorry im just not smart enough to fix this ..... i know very little c++  and im lucky if i dont burn myself with a soldering iron .....


Please just know i do this only out of love , and curiosity for the topic .... If i knew how to fix this i would of posted how i fixed it !


im just not that smart.... and i envy anyone who understands whats wrong with the code or  compilers  or whatever is wrong with it....

Look im lucky if i can get a hello world to pop up on a lcd ... let alone a tvout  on tiny basic  on software that is out of date ....
He is part of the dead...he has no place here. He has the stink of oil and electric circuitry about him. He is obsolete...
 

Offline hamster_nz

  • Super Contributor
  • ***
  • Posts: 2819
  • Country: nz
Re: AVR BASIC Computer....
« Reply #5 on: April 04, 2019, 09:19:47 am »
So I grabbed the latest Arduino (1.8.9), and the latest https://github.com/fuzzymannerz/AVR-BASIC-Computer repository.

I followed the instructions in the README and it built fine. The instructions are a bit vague about how to add the ATmega1284 support, but if you can select the ATmega1284 as the board you can't have gone too wrong.

It all builds fine:

Code: [Select]
Build options changed, rebuilding all
Sketch uses 15088 bytes (11%) of program storage space. Maximum is 130048 bytes.
Global variables use 8064 bytes (49%) of dynamic memory, leaving 8320 bytes for local variables. Maximum is 16384 bytes.

Sadly I don't have an ATmega1284 based board to actually test it on, but it looks like it should run.
Gaze not into the abyss, lest you become recognized as an abyss domain expert, and they expect you keep gazing into the damn thing.
 
The following users thanked this post: Kilroywashere

Offline mikerj

  • Super Contributor
  • ***
  • Posts: 3423
  • Country: gb
Re: AVR BASIC Computer....
« Reply #6 on: April 04, 2019, 03:22:01 pm »
than i got this one ----------------------------------------------------------------------------------------------

AVR_BASIC_Computer_V0.1:309:33: error: variable 'keywords' must be const in order to be put into read-only section by means of '__attribute__((progmem))'

 static unsigned char keywords[] PROGMEM = {

Tryed  to fix with this code-----------------------------------------------------------------

 static const unsigned char keywords[] PROGMEM = {


And what happened then?  You haven't explained what you current problem actually is.
 

Offline KilroywashereTopic starter

  • Regular Contributor
  • *
  • Posts: 112
  • Country: ca
  • He has the stink of oil and electric circuitry...
Re: AVR BASIC Computer....
« Reply #7 on: April 04, 2019, 04:12:26 pm »
than i got this one ----------------------------------------------------------------------------------------------

AVR_BASIC_Computer_V0.1:309:33: error: variable 'keywords' must be const in order to be put into read-only section by means of '__attribute__((progmem))'

 static unsigned char keywords[] PROGMEM = {

Tryed  to fix with this code-----------------------------------------------------------------

 static const unsigned char keywords[] PROGMEM = {


And what happened then?  You haven't explained what you current problem actually is.



Arduino: 1.8.9 (Windows 7), Board: "ATmega1284, Standard, 1284P, 2.7v, Disabled (default), 16 MHz external"

C:\Program Files\Arduino\libraries\ps2uartKeyboard\PS2uartKeyboard.cpp:136:49: error: variable 'scan2ascii_noshift' must be const in order to be put into read-only section by means of '__attribute__((progmem))'

 static PROGMEM unsigned char scan2ascii_noshift[] = {

                                                 ^

C:\Program Files\Arduino\libraries\ps2uartKeyboard\PS2uartKeyboard.cpp:155:47: error: variable 'scan2ascii_shift' must be const in order to be put into read-only section by means of '__attribute__((progmem))'

 static PROGMEM unsigned char scan2ascii_shift[] = {

                                               ^

exit status 1
Error compiling for board ATmega1284.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.






I have to actually declare the array as const... but i dunno how
« Last Edit: April 04, 2019, 04:24:30 pm by Kilroywashere »
He is part of the dead...he has no place here. He has the stink of oil and electric circuitry about him. He is obsolete...
 

Offline KilroywashereTopic starter

  • Regular Contributor
  • *
  • Posts: 112
  • Country: ca
  • He has the stink of oil and electric circuitry...
Re: AVR BASIC Computer....
« Reply #8 on: April 04, 2019, 04:46:35 pm »
I changed 
static unsigned char keywords[] PROGMEM = {
to
 static const unsigned char keywords[] PROGMEM = {


now im getting
Arduino: 1.8.9 (Windows 7), Board: "ATmega1284, Standard, 1284P, 2.7v, Disabled (default), 16 MHz external"

avrcomp:306:28: error: uninitialized const 'program' [-fpermissive]

 static const unsigned char program[kRamSize];

                            ^

C:\Users\Me\Documents\Arduino\avrcomp\avrcomp.ino: In function 'void loop()':

avrcomp:992:17: error: invalid conversion from 'const unsigned char*' to 'unsigned char*' [-fpermissive]

   program_start = program;

                 ^

avrcomp:994:16: error: invalid conversion from 'const unsigned char*' to 'unsigned char*' [-fpermissive]

   sp1 = program+sizeof(program);  // Needed for printnum

                ^

avrcomp:995:40: error: invalid conversion from 'const unsigned char*' to 'unsigned char*' [-fpermissive]

   stack_limit = program+sizeof(program)-STACK_SIZE;

                                        ^

avrcomp:1005:16: error: invalid conversion from 'const unsigned char*' to 'unsigned char*' [-fpermissive]

   sp1 = program+sizeof(program);

                ^

exit status 1
uninitialized const 'program' [-fpermissive]
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

do they all have ti have const in it??



static const unsigned char program[kRamSize];
static const char *  sentinel = "AVR BASIC Computer V0.1";
static unsigned char *txtpos,*list_line;
static unsigned char expression_error;
static unsigned char *tempsp;
« Last Edit: April 04, 2019, 04:57:41 pm by Kilroywashere »
He is part of the dead...he has no place here. He has the stink of oil and electric circuitry about him. He is obsolete...
 

Offline KilroywashereTopic starter

  • Regular Contributor
  • *
  • Posts: 112
  • Country: ca
  • He has the stink of oil and electric circuitry...
Re: AVR BASIC Computer....
« Reply #9 on: April 04, 2019, 04:59:31 pm »
I have deleted and retried like 4 times... i really want this to work.......


Im going to delete all the arduin stuff i have and try again.....
He is part of the dead...he has no place here. He has the stink of oil and electric circuitry about him. He is obsolete...
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9983
  • Country: us
Re: AVR BASIC Computer....
« Reply #10 on: April 04, 2019, 06:19:49 pm »
What about hamster_nz's reply above?  He got the code to build by downloading the latest Arduino software and the latest BASIC project and just following the README and has also offered to walk through this with you via PM.

You won't get a better answer...

If your processor isn't directly supported and known to work (dozens of working systems), change boards.  At least for round 1.  You can always change boards later on.
 
The following users thanked this post: Kilroywashere

Offline KilroywashereTopic starter

  • Regular Contributor
  • *
  • Posts: 112
  • Country: ca
  • He has the stink of oil and electric circuitry...
Re: AVR BASIC Computer....
« Reply #11 on: April 04, 2019, 06:23:27 pm »
What about hamster_nz's reply above?  He got the code to build by downloading the latest Arduino software and the latest BASIC project and just following the README and has also offered to walk through this with you via PM.

You won't get a better answer...

If your processor isn't directly supported and known to work (dozens of working systems), change boards.  At least for round 1.  You can always change boards later on.

yup that's why im deleting arduino to start over... im going to trust him and keep trying till i get it ....  ill follow the readme as he said
He is part of the dead...he has no place here. He has the stink of oil and electric circuitry about him. He is obsolete...
 

Offline KilroywashereTopic starter

  • Regular Contributor
  • *
  • Posts: 112
  • Country: ca
  • He has the stink of oil and electric circuitry...
Re: AVR BASIC Computer....
« Reply #12 on: April 04, 2019, 10:38:39 pm »
 :horse: :horse: :horse: :horse: :horse: :horse: :horse: :horse: :horse: :horse: :horse: :horse:


Question is.... Did i connect things right .....

Ok so i think i got the code to work?! it can verify now....


I have been using this schematic  and arduino as isp ..... and i added a 10uf cap on the reset and g .


I get this error when compiling , does it mean that the atmega1284pu will not work with the atmega1284p??? or is it finding my arduino isp and saying thats not the right one .....

 If the correct one can't be found can i create a new "boards" definition, or modify an existing one to correct the signature. if so how ?
Maybe i just have to keep playing with the bord manager ?
I think i got the wiring done right  sorry for thr bad pics i cant seem to put the good ones i have on there



--------------------------------------------------------------------------------------------------------

Arduino: 1.8.9 (Windows 7), Board: "ATmega1284, Standard, 1284, 2.7v, Disabled (default), 16 MHz external"

Sketch uses 15236 bytes (11%) of program storage space. Maximum is 130048 bytes.
Global variables use 8064 bytes (49%) of dynamic memory, leaving 8320 bytes for local variables. Maximum is 16384 bytes.
avrdude: Expected signature for ATmega1284 is 1E 97 06
         Double check chip, or use -F to override this check.
Wrong microcontroller found.  Did you select the right board from the Tools > Board menu?

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.



« Last Edit: April 04, 2019, 11:20:43 pm by Kilroywashere »
He is part of the dead...he has no place here. He has the stink of oil and electric circuitry about him. He is obsolete...
 

Offline KilroywashereTopic starter

  • Regular Contributor
  • *
  • Posts: 112
  • Country: ca
  • He has the stink of oil and electric circuitry...
Re: AVR BASIC Computer....
« Reply #13 on: April 04, 2019, 11:40:13 pm »
I downloaded 3 dif bord managers  they all give me the same


 avrdude: Expected signature for ATmega1284P is 1E 97 05
         Double check chip, or use -F to override this check.
Wrong microcontroller found.  Did you select the right board from the Tools > Board menu?


it has to be the fact its a atmega1284pu right???
He is part of the dead...he has no place here. He has the stink of oil and electric circuitry about him. He is obsolete...
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9983
  • Country: us
Re: AVR BASIC Computer....
« Reply #14 on: April 05, 2019, 12:35:22 am »
Have you searched for 'programming atmega1284p with uno r3'?  The top reply when I searched was:
http://www.technoblogy.com/show?19OV

The author goes through 3 approaches but, in the end, you need to modify the board file - instructions and code given.
 
The following users thanked this post: Kilroywashere

Offline KilroywashereTopic starter

  • Regular Contributor
  • *
  • Posts: 112
  • Country: ca
  • He has the stink of oil and electric circuitry...
Re: AVR BASIC Computer....
« Reply #15 on: April 05, 2019, 12:38:02 am »
Have you searched for 'programming atmega1284p with uno r3'?  The top reply when I searched was:
http://www.technoblogy.com/show?19OV

The author goes through 3 approaches but, in the end, you need to modify the board file - instructions and code given.

ill give that a try thank you ! if i ever get this done! i will be so happy LOL
He is part of the dead...he has no place here. He has the stink of oil and electric circuitry about him. He is obsolete...
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9983
  • Country: us
Re: AVR BASIC Computer....
« Reply #16 on: April 05, 2019, 12:50:08 am »
More here:

http://forum.arduino.cc/index.php?topic=320009.0

3/4 the way down here:

https://www.instructables.com/id/ATMega1284P-Guitar-and-Music-Effects-Pedal/

There's a ton of information on doing this but it is not as easy as programming a Uno R3 from the IDE.
 

Offline KilroywashereTopic starter

  • Regular Contributor
  • *
  • Posts: 112
  • Country: ca
  • He has the stink of oil and electric circuitry...
Re: AVR BASIC Computer....
« Reply #17 on: April 06, 2019, 02:55:04 am »
I know you guys must hate me by now.....  I have keep trying to get this to work and its not....


My issue now is that I can connect the atmega1284pu and flash a led or do whatever .... but when i load the AVR Computer Code  it gives me this message

-----------------------------------------------------------------------------------------------------------------------------------------------------
Arduino: 1.8.9 (Windows 7), Board: "ATmega1284, Yes (UART0), Standard pinout, 1284, BOD 2.7V, LTO disabled, 16 MHz external"

libraries\SpiEEPROM\spieeprom.cpp.o: In function `SPIEEPROM::setup()':

C:\Program Files\Arduino\libraries\SpiEEPROM/spieeprom.cpp:31: undefined reference to `SPIClass::begin()'

collect2.exe: error: ld returned 1 exit status

exit status 1
Error compiling for board ATmega1284.         

------------------------------------------------------------------------------------------------------------------------------------------------------

So i dunno if that means it cant find the atmega1284 or  I dunno what it means ehen it said .....

undefined reference to `SPIClass::begin()' collect2.exe: error: ld returned 1 exit status
He is part of the dead...he has no place here. He has the stink of oil and electric circuitry about him. He is obsolete...
 

Online bingo600

  • Super Contributor
  • ***
  • Posts: 2056
  • Country: dk
Re: AVR BASIC Computer....
« Reply #18 on: April 08, 2019, 07:19:54 pm »
It mean it can't find the SPI library needed by the spieeprom library.

If you haven't built (connected) an EXTERNAL spi-eeprom chip into the system you have made , you can skip the whole library

/Bingo
 

Offline Doctorandus_P

  • Super Contributor
  • ***
  • Posts: 4027
  • Country: nl
Re: AVR BASIC Computer....
« Reply #19 on: April 09, 2019, 12:29:31 am »
I've always found BASIC a horrible language and putting a BASIC interpreter on an AVR uC makes even less sense.

The vast mayority of uC's run code that is generated with a C or C++ compiler.

If you really want to work with an interpreted language, then a language like MicroPython seems to be a much more logical choise.
MicroPython can also run on boards like the Wemos D1 Mini which is a pretty cheap ESP8266 board.
It's about the size and price of a postage stamp from China.

Such boards also have much more room to store your (interpreted) program (upto Megabytes) and the processor is also much more capable (160MHz or so).

Oh, I forgot. It's also has built in Wifi if you're interested in that, but even without the WiFi the ESP8266 is a quite impressive little critter for the price.

But be carefull. the ESP8266 is a bit fragile. It is 3V3 only and not tolerant of over voltages and also not very robust against ESD events.

 
The following users thanked this post: elecdonia

Offline mikerj

  • Super Contributor
  • ***
  • Posts: 3423
  • Country: gb
Re: AVR BASIC Computer....
« Reply #20 on: April 10, 2019, 12:18:02 pm »
I've always found BASIC a horrible language and putting a BASIC interpreter on an AVR uC makes even less sense.

God forbid that anyone wants to build something for fun.  I suppose you are also dead set against e.g. people creating 8 bit CPUs out of TTL because you can buy one for pennies?
 

Offline profdc9

  • Frequent Contributor
  • **
  • Posts: 335
  • Country: us
Re: AVR BASIC Computer....
« Reply #21 on: April 10, 2019, 03:53:13 pm »
I have made a ARM-based BASIC computer.  You can take a look at

http://jumentum.sourceforge.net/

It does TV output and uses a PS/2 keyboard.  All supports file storage on SD cart and does TCP/IP over ethernet as well.

Dan
 
The following users thanked this post: mikerj, iMo

Offline KilroywashereTopic starter

  • Regular Contributor
  • *
  • Posts: 112
  • Country: ca
  • He has the stink of oil and electric circuitry...
Re: AVR BASIC Computer....
« Reply #22 on: April 19, 2019, 05:47:44 am »
Uhh hey guys ... yeah its me again .... :(


SO its been a long time messing with this thing.... i still cant get it to work no mater what i do ...

i get an error with this part of code
----------------------------------------------------------------------
// includes, and settings for Arduino-specific functionality
#ifdef ENABLE_EEPROM
long eepos = 0;
// EEPROM IC
#include <SPI.h>
#include <Arduino.h>
SPIEEPROM disk1(0);  // Type 0 = 16bit address
#endif


---------------------------------------------------------------

AVR_BASIC_Computer_v0.1:2101:7: error: 'disk1' was not declared in this scope

     

The error tells me that 'SPIEEPROM' does not name a type

So how would i go about giving disk1 a name?


Honestly i really wanna know what is going on and why this is so hard for me ....
If anyone with code experience can help me understand whats going on with the code maybe teach me a few fundamentals or send me to a link online that might help me out?


sorry to bug you guys with this one really....




again uhhh good videos or other projects that might help build my knowledge up would be great ...


umm thanks guys... and again sorry   
« Last Edit: April 19, 2019, 07:19:19 am by Kilroywashere »
He is part of the dead...he has no place here. He has the stink of oil and electric circuitry about him. He is obsolete...
 


Offline donotdespisethesnake

  • Super Contributor
  • ***
  • Posts: 1093
  • Country: gb
  • Embedded stuff
Re: AVR BASIC Computer....
« Reply #24 on: April 20, 2019, 12:46:31 pm »

i get an error with this part of code
----------------------------------------------------------------------
// includes, and settings for Arduino-specific functionality
#ifdef ENABLE_EEPROM
long eepos = 0;
// EEPROM IC
#include <SPI.h>
#include <Arduino.h>
SPIEEPROM disk1(0);  // Type 0 = 16bit address
#endif


---------------------------------------------------------------

AVR_BASIC_Computer_v0.1:2101:7: error: 'disk1' was not declared in this scope

     

The error tells me that 'SPIEEPROM' does not name a type

So how would i go about giving disk1 a name?

That means that Arduino cannot find the SpiEEPROM library. Have you installed it correctly?

I am trying to build this project with Arduino 1.8.3, but I am having various problems...

ETA: well, that project is pretty messed up, usual case of bitrot I guess.

Anyway, it appears your hardware does not have external EEPROM, but the code doesn't build without it.

You need to change

Code: [Select]
#define ENABLE_EEPROM 1
//#undef ENABLE_EEPROM

to

Code: [Select]
//#define ENABLE_EEPROM 1
#undef ENABLE_EEPROM

and also in void setup()

Change the code to read

Code: [Select]
  #ifdef ENABLE_EEPROM
  // EEPROM IC
  disk1.setup();
 
  printnum(8192);
  printmsg(eeprommsg);
  #endif /* ENABLE_EEPROM */

And then you should be able to build it.

« Last Edit: April 20, 2019, 02:43:47 pm by donotdespisethesnake »
Bob
"All you said is just a bunch of opinions."
 
The following users thanked this post: elecdonia


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf