Show Posts
Pages: 1 2 [3] 4 5 ... 139
31  Community / Exhibition / Gallery / Re: Arduino 6502 emulator + BASIC interpreter on: July 01, 2014, 12:06:53 pm
Ok, I converted the rom and changed to (I am not using the video version yet):
Code:
uint8_t read6502(uint16_t address) {
  uint8_t tempval = 0;

  if (address == 0xF004) { //EhBASIC simulated ASIC input
    tempval = getkey();
    clearkey();
    return(tempval);
  }

  if ((address >= 0xA000)&&(address < 0xC000)) return BIOS[(address - 0xA000)];
  if (address >= 0xE000) return BIOS[(address - 0xC000)];
  if ((address >= 0xD000)&&(address < 0xD800)) return(0);
  if (address < RAM_SIZE) return(RAM[address]);  

}

void write6502(uint16_t address, uint8_t value) {
  if (address < RAM_SIZE) RAM[address] = value;
  if (address == 0xF001) { //EhBASIC simulated ASIC output
    serout(value);
  }
}

32  Community / Exhibition / Gallery / Re: Arduino 6502 emulator + BASIC interpreter on: July 01, 2014, 11:51:26 am
Do we still need the
Code:
prog_uchar BIOStop[256] PROGMEM = {....
stuff there?
33  Community / Exhibition / Gallery / Re: Arduino 6502 emulator + BASIC interpreter on: July 01, 2014, 11:10:40 am
So in order to run c64 v2 I need Basic and kernal roms, and I need to convert  them into the "source format". I guess I need to change the addresses in the cpu.c as well (I am using the original code without the display stuff..). Are there any other changes needed?
34  Community / Exhibition / Gallery / Re: Arduino 6502 emulator + BASIC interpreter on: July 01, 2014, 05:55:19 am
The enhanced basic 2.22 has only 6digits fp - that is a..  smiley-roll
I've just tried the "**** COMMODORE 64 BASIC V2 **** " (the "dos" version) and it has got 9 digits precision, what is _much_ better stuff..
Is there a chance to load that rom from somewhere??
35  Community / Exhibition / Gallery / Re: Arduino 6502 emulator + BASIC interpreter on: June 30, 2014, 10:14:49 am
Who is complaining the emulator is slow??
This is calculated (and printed out @115k2) in 8.07 seconds:
Code:
6502 EhBASIC [C]old/[W]arm ?

Memory size ?

31231 Bytes free

Enhanced BASIC 2.22

Ready
5  REM TRIGONOMETRIC FUNCTIONS TEST 1..89 DEGREE
10 PH = 3.141592653/2.0
15 REM DEFINE ARCSIN AND ARCCOS
20 DEF FN ASN(X) = ATN(X/SQR(1.0-X*X))
30 DEF FN ACS(X) = PH-ATN(X/SQR(1.0-X*X))
35 REM TR, TD - TO RAD, TO DEG
40 TR = 3.141592653 / 180.0
50 TD = 180.0 / 3.141592653
55 REM INPUT IN DEGREE (1..89)
60 FOR D = 1 TO 89
70 R = D * TR
80 S = FN ASN(FN ACS(ATN(TAN(COS(SIN(R))))))
90 T = S * TD
100 PRINT T; " "; D; " "; T-D; " "; FRE(1)
110 NEXT D
120 END

RUN
 .999995  1 -4.52995E-06  30753
 2.00008  2  8.39233E-05  30753
 2.99996  3 -4.50611E-05  30753
 3.99999  4 -1.26362E-05  30753
 4.99997  5 -2.95639E-05  30753
 5.99996  6 -4.52995E-05  30753
 6.99998  7 -2.43187E-05  30753
 7.99999  8 -9.53674E-06  30753
 8.99998  9 -1.90735E-05  30753
 9.99994  10 -5.62668E-05  30753
..
 87.0002  87  1.75476E-04  30753
 87.9999  88 -6.86646E-05  30753
 89.0001  89  5.34058E-05  30753

Cool!  smiley-wink
36  Community / Exhibition / Gallery / Re: Arduino 6502 emulator + BASIC interpreter on: June 30, 2014, 05:01:33 am
Nice project! Congratulation!

I took the source from the first post and compiled for the 1284p mighty. I changed the RAM_SIZE to 10000 in cpu.c.
It compiles and I get
Code:
6502 EhBASIC [C]old/[W]arm ?

Memory size ?
in my terminal.
Sorry for my naive question - what needs to be done next? When I enter a number (or I just press enter) I see nothing.. smiley

PS: I've changed to TeraTerm terminal and it seems it works:
Code:
6502 EhBASIC [C]old/[W]arm ?

Memory size ?

9231 Bytes free

Enhanced BASIC 2.22

Ready
37  Development / Other Hardware Development / Re: Anyone tried ST Nucleo boards? on: June 29, 2014, 04:43:33 am
Quote
Starting read test.  Please wait up to a minute
Read 4261.15 KB/sec
That is  only 19% overhead @42MHz SPI clock. Nice!
38  Development / Other Hardware Development / Re: Anyone tried ST Nucleo boards? on: June 29, 2014, 03:17:18 am
Quote
With these subsidized Evaluation Boards from Chip vendors, it's a lot harder to get that 'feel' for end product cost
The nucleo boards must not be "subsidized".. All the boards are the same, as the chips have the same pinout. So they produce 9 variants of nucleo boards on the same pcb. The price of the 2 chips used is "not known" as it comes from STM (that could be called "subsidizing"). With 50k-100k boards from each variant they may do a profit, indeed..
PS: there was a discussion whether the Discovery boards are subsidized, an insider indicated they are not..
PS1: the chip vendors follow a "what the market will bear" strategy when pricing the chips. Internally they cost them "at costs". That is a huge difference of course. Moreover, for such demo boards they may use chips coming from batches which are a little bit off certain parameters.
PS2: my rough estimate: the development costs of a stm32F401 mcu could be $300k, fab preparation $200k, and the production costs of a single smd packaged chip about 50cents (rather conservative estimate, it could be less). They sell it to distributors and large volume clients for $3 a piece in an average (10k quantities). So they break even when they sell 200k chips.. It seems to me to put 10.000 chips into a nucleo board "at cost" may not ruin their business case.. smiley
39  Development / Other Hardware Development / Re: Anyone tried ST Nucleo boards? on: June 28, 2014, 04:49:58 pm
Long time back I did experiments with SDIO on the F407 (@168MHz)under chibios and 5MB/sec was easy to get with 32kB blocks. My experiments were suboptimal, so I guess you may get 4-5MB/sec@84MHz..
40  Development / Other Hardware Development / Re: Anyone tried ST Nucleo boards? on: June 28, 2014, 02:40:47 pm
What is your SPI clock?
41  Development / Other Hardware Development / Re: Anyone tried ST Nucleo boards? on: June 27, 2014, 03:06:00 pm
.. moreover, you can run the code out of the external sdram.. Performance like a desktop PC in '93.. (or better with filesystem on the SDIO sdcard) smiley
42  Development / Other Hardware Development / Re: Anyone tried ST Nucleo boards? on: June 27, 2014, 01:11:11 pm
I am a big fan of the Discovery boards, but it seems the NUCLEO offering is quite large too:

Quote
The external SRAM has a 16-bit data bus and runs at 80 MHz.
It is an SDRAM. The r/w access to it is about 6x slower than to the internal on-chip sram.

PS: the 3xx and 4xx chips include an FPU (32bit single precision, +-* 1cycle, MAC-like 3cycles and / sqrt 14cycles) and 1cycle SIMDs.
43  Using Arduino / Storage / Re: SDfat slow buffer flush on: June 21, 2014, 10:07:33 am
Quote
I am looking to get a stable logging frequency of around 100 Hz. Currently I am sending 40 data samples to the buffer before flushing to the SD card and without the delay of 5 milli seconds I am able to log up to around 800 Hz.
The problem I am having is the time taken to flush values to the SD. It takes approx. 14 ms to flush the values meaning I miss capturing data during that period. When sending and flushing 1 value per loop the maximum frequency I can get is only around 60Hz.

What is the data rate you want to log??

I would estimate the 4 analog and the 6 IMU might be:  

Code:
(4 + 6) * 2 bytes = 20bytes
plus a timestamp ie. 4 bytes
total = 24bytes.

100x per second to log means 2.4kBytes/second data rate (my assumption here is the IMU is able to provide the data 100x per second).

An sdcard has the write latencies of dozens of milliseconds up to 250ms each XYZ milliseconds (almost random).

So in order to save 2.4kBytes/second to the sdcard, you need a FIFO buffer. The size of the FIFO buffer, worst case is:

Code:
FIFO_size = data_rate * worst_case_latency = 2.4kB/sec * 250msec = 600Bytes.

With a 600 Bytes large FIFO and the NilRtos you may (most probably) save your data on any sdcard.

PS: this topic has been discussed here many times. Search this forum for "Nilrtos Fifo"..




44  Products / Arduino Due / Re: "PORTC =" command cannot compile in Arduino Due mode?? on: May 23, 2014, 11:33:13 am
Quote
I am trying to interface a TFT display in the Arduino Due
You may use the EMB SMC bus - with Parallel library - it could be used for displays as well. There is an example for connecting an LCD too..
https://github.com/delsauce/ArduinoDueParallel
45  Using Arduino / Microcontrollers / Re: Barebones 328 ( 8MHz) access PB6 PB7 on: May 23, 2014, 11:25:12 am
You must change the fuse setting as well.
Pages: 1 2 [3] 4 5 ... 139