AVR BASIC Computer....  - Page 1
Forum section: electronics / general

author: Kilroywashere
author_rank: Regular Contributor
timestamp: April 04, 2019, 12:19:49 am
content: HeyBeen 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 ishttps://github.com/fuzzymannerz/AVR-BASIC-ComputerI 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 foundhttps://hackaday.io/project/3537/instructionsand i think people are having the same issues as me.....

author: hamster_nz
author_rank: Super Contributor
timestamp: April 04, 2019, 01:00:35 am
content: 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...

author: iMo
author_rank: Super Contributor
timestamp: April 04, 2019, 06:02:04 am
content: Why do you start a second thread with the same issues?https://www.eevblog.com/forum/microcontrollers/atmega1284-programming-issues/msg2316555/#msg2316555The issues you have got are standard one. Also mind the atmega1284 is not supported by Arduino company, afaik. Moreover there is thehttps://forum.arduino.cc/you may ask too.

author: Kilroywashere
author_rank: Regular Contributor
timestamp: April 04, 2019, 07:20:16 am
content: Quote from: imo on April 04, 2019, 06:02:04 amI 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...

author: Kilroywashere
author_rank: Regular Contributor
timestamp: April 04, 2019, 07:36:33 am
content: 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 ....

author: hamster_nz
author_rank: Super Contributor
timestamp: April 04, 2019, 09:19:47 am
content: So I grabbed the latest Arduino (1.8.9), and the latesthttps://github.com/fuzzymannerz/AVR-BASIC-Computerrepository.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:Build options changed, rebuilding allSketch 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.

author: mikerj
author_rank: Super Contributor
timestamp: April 04, 2019, 03:22:01 pm
content: Quote from: Kilroywashere on April 04, 2019, 12:19:49 amAnd what happened then? You haven't explained what you current problem actually is.

author: Kilroywashere
author_rank: Regular Contributor
timestamp: April 04, 2019, 04:12:26 pm
content: Quote from: mikerj on April 04, 2019, 03:22:01 pmArduino: 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 1Error 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

author: Kilroywashere
author_rank: Regular Contributor
timestamp: April 04, 2019, 04:46:35 pm
content: I changedstatic unsigned char keywords[] PROGMEM = {tostatic const unsigned char keywords[] PROGMEM = {now im gettingArduino: 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;^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 1uninitialized const 'program' [-fpermissive]-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=do they all have ti have const in it??static const unsigned char program;static const char * sentinel = "AVR BASIC Computer V0.1";static unsigned char *txtpos,*list_line;static unsigned char expression_error;static unsigned char *tempsp;

author: Kilroywashere
author_rank: Regular Contributor
timestamp: April 04, 2019, 04:59:31 pm
content: 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.....

author: rstofer
author_rank: Super Contributor
timestamp: April 04, 2019, 06:19:49 pm
content: 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.

author: Kilroywashere
author_rank: Regular Contributor
timestamp: April 04, 2019, 06:23:27 pm
content: Quote from: rstofer on April 04, 2019, 06:19:49 pmyup 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

author: Kilroywashere
author_rank: Regular Contributor
timestamp: April 04, 2019, 10:38:39 pm
content: 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 06Double 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.

author: Kilroywashere
author_rank: Regular Contributor
timestamp: April 04, 2019, 11:40:13 pm
content: I downloaded 3 dif bord managers they all give me the sameavrdude: Expected signature for ATmega1284P is 1E 97 05Double 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???

author: rstofer
author_rank: Super Contributor
timestamp: April 05, 2019, 12:35:22 am
content: Have you searched for 'programming atmega1284p with uno r3'? The top reply when I searched was:http://www.technoblogy.com/show?19OVThe author goes through 3 approaches but, in the end, you need to modify the board file - instructions and code given.

author: Kilroywashere
author_rank: Regular Contributor
timestamp: April 05, 2019, 12:38:02 am
content: Quote from: rstofer on April 05, 2019, 12:35:22 amill give that a try thank you ! if i ever get this done! i will be so happy LOL

author: rstofer
author_rank: Super Contributor
timestamp: April 05, 2019, 12:50:08 am
content: More here:http://forum.arduino.cc/index.php?topic=320009.03/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.

author: Kilroywashere
author_rank: Regular Contributor
timestamp: April 06, 2019, 02:55:04 am
content: 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 statusexit status 1Error 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

author: bingo600
author_rank: Super Contributor
timestamp: April 08, 2019, 07:19:54 pm
content: 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

author: Doctorandus_P
author_rank: Super Contributor
timestamp: April 09, 2019, 12:29:31 am
content: 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.

author: mikerj
author_rank: Super Contributor
timestamp: April 10, 2019, 12:18:02 pm
content: Quote from: Doctorandus_P on April 09, 2019, 12:29:31 amGod 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?

author: profdc9
author_rank: Frequent Contributor
timestamp: April 10, 2019, 03:53:13 pm
content: I have made a ARM-based BASIC computer. You can take a look athttp://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

author: Kilroywashere
author_rank: Regular Contributor
timestamp: April 19, 2019, 05:47:44 am
content: 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_EEPROMlong 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 scopeThe error tells me that 'SPIEEPROM' does not name a typeSo 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

author: RES
author_rank: Regular Contributor
timestamp: April 19, 2019, 12:10:51 pm
content: https://electronics.stackexchange.com/questions/86207/atmega8-why-do-vcc-and-avcc-have-to-be-connected

author: donotdespisethesnake
author_rank: Super Contributor
timestamp: April 20, 2019, 12:46:31 pm
content: Quote from: Kilroywashere on April 19, 2019, 05:47:44 amThat 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 changeCode:#define ENABLE_EEPROM 1//#undef ENABLE_EEPROMtoCode://#define ENABLE_EEPROM 1#undef ENABLE_EEPROMand also invoid setup()Change the code to readCode:#ifdef ENABLE_EEPROM// EEPROM ICdisk1.setup();printnum(8192);printmsg(eeprommsg);#endif /* ENABLE_EEPROM */And then you should be able to build it.

author: donotdespisethesnake
author_rank: Super Contributor
timestamp: April 20, 2019, 02:52:37 pm
content: A nicely obscure C gotcha.https://github.com/fuzzymannerz/AVR-BASIC-Computer/issues/2

author: Kilroywashere
author_rank: Regular Contributor
timestamp: April 24, 2019, 08:16:26 am
content: Yep i'm still flogging a dead horse... Still cant get it to work but i started to look up how to make a serial monitor with the arduino uno ... having issues getting anything to display on the tv still....I do wonder if anyone has gotten this AVR Computer to work?I do have a question , Someone had posted a reply about that it is good practice to connect VCC with AVCC .... is it better to hook up the atmega 1248 on breadboard with its own power supply in appose to using the unos power?Anyway im not giving up on this project ... and i will continue to try to get anything to workPlease post anything you think might be useful to me or any alternative projects like this.... Thank you guys for any help you may have done already

author: donotdespisethesnake
author_rank: Super Contributor
timestamp: April 26, 2019, 08:01:10 pm
content: Quote from: Kilroywashere on April 24, 2019, 08:16:26 amYes, several people... But what hardware are you actually trying to get to work?I was going to order a PCB but it seems the originator of the project is no longer active, and Dans Electronics no longer exists. This weekend I might create a PCB in Kicad.

author: Kilroywashere
author_rank: Regular Contributor
timestamp: April 28, 2019, 10:41:32 pm
content: I really need help guys.... Im at my wits end its been a long time and i just cant get this to work.... Im just to dumb....I have even tried this projecthttps://www.instructables.com/id/Arduino-Basic-PC-With-TV-Output/But i cannot get the slave to work ... and the guy has not left any numbers to pins or anything .... so i have to guess where they go .... the issue is its a SMD arduino and i have a dip package ....I really need some help... If someone could spare me a few min of there time to maybe help me get the slave part to workSince the TV.Out is just to hard to get to work on tiny basic I thought this one would be better cuz it uses a serial monitor to get it to work..... and this "SLAVE" outputs the serial to the tv ...I dont know why this had turned into a nightmare .... but it has and now i cant give up.... Please give any advice or link to videos that might help me ....Thank you so much ...

author: iMo
author_rank: Super Contributor
timestamp: April 29, 2019, 06:23:38 am
content: In case you work with naked DIP package, the first step is to download its Datasheet and get familiar with pin names and numbering.The linked page says:QuoteThe note above says the master sends the data to slave via the serial UART.I would advice you to insert a 470ohm resistor into the Tx->Rx wire in case you mess something up.Also the grounds have to be interconnected in order to get the serial work.The arduino bootloader works via Tx/Rx, therefore the advice to disconnect the master-slave wire when updating the sketch.Messing with naked DIP or SMD atmega328p or atmega32 or atmega1284p, or with 3rd parties boards, requires apretty good understandinghow the "Arduino Boards pin numbering" vs. "XY Board's pin names/numbering" vs. "DIP/SMD package pin names/numbering" works.Again, there is a great Arduino forum athttps://forum.arduino.cc/where the Arduino experts answer almost any question to beginners.