From: MooseFET on 19 May 2010 20:17 On May 19, 9:05 am, Jan Panteltje <pNaonStpealm...(a)yahoo.com> wrote: > On a sunny day (Wed, 19 May 2010 05:39:56 -0700 (PDT)) it happened MooseFET > <kensm...(a)rahul.net> wrote in > <b1c4a991-5481-4d29-96c6-c93c780a1...(a)h37g2000pra.googlegroups.com>: > > > > >On May 19, 3:44 am, Jan Panteltje <pNaonStpealm...(a)yahoo.com> wrote: > >> I just wrote a program for a Microchip PIC 18F14K22 microcontroller > >> driving a ENC28J60 Ethernet controller in ASM. > >> Because this PIC's SPI interface does not work in I bitbanged it,,, > >> As this PIC has only 256 bytes of RAM..... > > >> So far so good... But what does it do??? > >> Well many things, but one of it is that it (oh it has a MAX232 too, ye= > > know a MAXIM chip, I have some, > >> the rumour that those do not exist is false, but you do not need the MAXI= > >M chip you > >> can do it with a NPN transistor and diode), > > >Digikey has some LT1081s. They have the same pine out as the MAX232 > >but > >is less likely to blow up. > > I do not remember ever having killed a MAX232 :-) I've killed at least one with a large ESD blast. Another got nailed by a miswire. > > >[....] > >> Now there is free code space, free code space free code space, whatshallw= > >edo with the free code space? > >> I have some idea. > > >You could store the manual internally. > > Yes, I have that in some other PIC project, huge menu. > But it would not fit here, with examples I think. > It could point to an URL though. > mmm idea:-) It could even say "The manual is at www.myweb.com/manual/123456.pdf"
From: Tim Williams on 19 May 2010 20:46 "Bitrex" <bitrex(a)de.lete.earthlink.net> wrote in message news:E-ydndNy_Iic7GnWnZ2dnUVZ_gednZ2d(a)earthlink.com... > I'd love to try it out, but I'm an AVR guy - I wonder how difficult it > would be to port the code to use on something like an ATMega168.... Considering how awful the PIC is, that could take a while :) I don't entirely like the AVR instruction set. 200+ instructions and hardly any of them do anything, in and of themselves. Any basic operation requires two or more (load, modify, store). So as nice as it is, it's tedious to use. Despite the tedium, it's definitely easy to use. It's got gobs of registers, flat address space and lots of RAM (ATmega32 = 1k RAM, 512 EEPROM, 32k Flash). If it had a rich instruction set closer to Z80 or HC11 or something like that, and came with a macro assembler, I wouldn't need anything else. Tim -- Deep Friar: a very philosophical monk. Website: http://webpages.charter.net/dawill/tmoranwms
From: Bitrex on 20 May 2010 03:01 Tim Williams wrote: > "Bitrex" <bitrex(a)de.lete.earthlink.net> wrote in message > news:E-ydndNy_Iic7GnWnZ2dnUVZ_gednZ2d(a)earthlink.com... >> I'd love to try it out, but I'm an AVR guy - I wonder how difficult it >> would be to port the code to use on something like an ATMega168.... > > Considering how awful the PIC is, that could take a while :) > I'm not entirely clear from the OP whether just the SPI protocol is implemented in assembly, or if the entire program is assembly. Assuming the ATMega has a working SPI bus if the rest of the code is in C one would probably just have to modify things like I/O port assignments and interrupt timing/handling. If it's all assembly, well then one might be better off just writing it from scratch...:) > I don't entirely like the AVR instruction set. 200+ instructions and hardly > any of them do anything, in and of themselves. Any basic operation requires > two or more (load, modify, store). So as nice as it is, it's tedious to > use. Despite the tedium, it's definitely easy to use. > It's got gobs of registers, flat address space and lots of RAM (ATmega32 = > 1k RAM, 512 EEPROM, 32k Flash). If it had a rich instruction set closer to > Z80 or HC11 or something like that, and came with a macro assembler, I > wouldn't need anything else. Atmel sez: "Many people believe RISC is an acronym for "Reduced Instruction Set Computer", and that a RISC must have a limited number of instructions. But those familiar with the history of how the terms RISC and CISC were coined will know that RISC is an acronym for "Reduced COMPLEXITY Instruction Set Computer". But because RCISC didn't sound very elegant, the acronym RISC was applied to the theory. It is not the number of instructions that is reduced in the AVR instruction set; what is reduced is the complexity of the digital circuitry required to decode each instruction... blah blah blah Following countless iterations, the AVR architecture became optimized for C-code execution, with bottlenecks completely eliminated during the construction phase." So essentially it seems the instruction set is what it is because they figured everyone is going to be programming these things in C anyhow, so they created the instruction set with that in mind. I'm fine with that because personally I like abstraction and enjoy working in assembly about as much as a soldering iron in the eye. Ever messed around with a PDP-8? I'm not old enough to have used the real thing, but I wrote a little emulator in Python. It had a tight instruction set - just 6 base operations! Speaking of abstraction and Python, I just ordered an ATMega644 to see if I could get Python running on it via PyMite. > Tim >
From: Jan Panteltje on 20 May 2010 06:38 On a sunny day (Wed, 19 May 2010 19:10:24 -0400) it happened Bitrex <bitrex(a)de.lete.earthlink.net> wrote in <E-ydndNy_Iic7GnWnZ2dnUVZ_gednZ2d(a)earthlink.com>: >Jan Panteltje wrote: >> I just wrote a program for a Microchip PIC 18F14K22 microcontroller >> driving a ENC28J60 Ethernet controller in ASM. >> Because this PIC's SPI interface does not work in I bitbanged it,,, >> As this PIC has only 256 bytes of RAM..... >> >> So far so good... But what does it do??? >> Well many things, but one of it is that it (oh it has a MAX232 too, ye know a MAXIM chip, I have some, >> the rumour that those do not exist is false, but you do not need the MAXIM chip you >> can do it with a NPN transistor and diode), >> so: >> It streams the serial port to UDP worldwide, sort of internet radio. >> At 115200 Bd it just about can send a 64 kbps mp3 worldwide, and you can just hang >> a player on it (xine, mplayer, ffplay, whatever, best something with a cache or buffer). > >I'd love to try it out, but I'm an AVR guy - I wonder how difficult it >would be to port the code to use on something like an ATMega168.... I dunno, I wrote it in PIC 18 asm :-) But before that I wrote some test routines for the ENC28J60 Ethernet controller in C: http://panteltje.com/panteltje/jppecat/ I could have used compiler I guess, but I do not like C on such small micros. (256 byte RAM). So I rewrote it in asm... And added some I/O features, streaming too. You can for example use the serial port, and stream audio: cat my_music.mp3 > /dev/ttyS0 will stream UDP to port and Ip specified in the asm file. Other end can do: netcat -u -l -p 1024 | mpg123 -a /dev/dsp0 - I am not sure, and for sure not ready ,to release this asm code as open source, I think it is worth real money as a solution too. Or you can start a second netcat on the remote PC like this: netcat -u MY_IP 1024 and set digtal outputs, read digital inputs (via the first netcat), read analog values, and set a PWM output (now controls a LED brightness). The C code is GPL, so all it does is initialise the ethernet controller, send ARP request to find the MAC of the destination, or gateway, and go into a loop reading UDP packets and processing those, and reading stdin and sending that in UDP packets.
From: Jan Panteltje on 20 May 2010 06:41
On a sunny day (Wed, 19 May 2010 17:17:17 -0700 (PDT)) it happened MooseFET <kensmith(a)rahul.net> wrote in <9def4daa-3bdb-4ef3-908c-456975b232d6(a)u3g2000prl.googlegroups.com>: >On May 19, 9:05�am, Jan Panteltje <pNaonStpealm...(a)yahoo.com> wrote: >> On a sunny day (Wed, 19 May 2010 05:39:56 -0700 (PDT)) it happened MooseF= >ET >> <kensm...(a)rahul.net> wrote in >> <b1c4a991-5481-4d29-96c6-c93c780a1...(a)h37g2000pra.googlegroups.com>: >> >> >> >> >On May 19, 3:44�am, Jan Panteltje <pNaonStpealm...(a)yahoo.com> wrote: >> >> I just wrote a program for a Microchip PIC 18F14K22 microcontroller >> >> driving a ENC28J60 Ethernet controller in ASM. >> >> Because this PIC's SPI interface does not work in I bitbanged it,,, >> >> As this PIC has only 256 bytes of RAM..... >> >> >> So far so good... But what does it do??? >> >> �Well many things, but one of it is that it (oh it has a MAX232 too,= > ye= >> > know a MAXIM chip, I have some, >> >> the rumour that those do not exist is false, but you do not need the M= >AXI= >> >M chip you >> >> can do it with a NPN transistor and diode), >> >> >Digikey has some LT1081s. �They have the same pine out as the MAX232 >> >but >> >is less likely to blow up. >> >> I do not remember ever having killed a MAX232 :-) > >I've killed at least one with a large ESD blast. >Another got nailed by a miswire. Na, jaaa, lightning... |