Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Mike said:18F4620, 64 Kbytes (32 Kwords) Flash, 3986 bytes RAM, 1024 bytes EEPROM
gramo said:18F's are just bliss
gramo said:Not just the fact they are optimized for higher languages, but doesn't the Program Memory of 64 Kbytes appeal to you? Not to mention the fist full of other hardware features, some even have hardware USB support
No bank switching = linear memory addressing. They even have more low leveling programming functions/commands for more diversity with Assembler
Either way, they are a lot better than 16F PIC's, and they are not nearly as hard as most people are lead to believe
[B]device [/B]= 18F4550
[B]clock [/B]= 48
// 20Mhz crystal, 48Mhz internal (FS USB)
[B]config[/B]
PLLDIV = 5,
CPUDIV = OSC1_PLL2,
USBDIV = 2,
FOSC = HSPLL_HS,
VREGEN = ON
// import modules...
[B]include [/B]"usbhid.bas"
// TX report...
[B]structure [/B]TTXReport
Time [B]as word[/B]
Message [B]as string[/B]
[B]end structure[/B]
[B]dim [/B]TXReport [B]as[/B] TTXReport [B]absolute [/B]TXReportRAM
// RX report...
[B]structure [/B]TRXReport
LED0 [B]as bit[/B]
LED1 [B]as bit[/B]
[B]end structure[/B]
[B]dim [/B]RXReport [B]as [/B]TRXReport [B]absolute [/B]RXReportRAM
// alias port pins to LEDs...
[B]dim [/B]
LED0 [B]as [/B]PORTB.0,
LED1 [B]as [/B]PORTB.1
// initialise...
TXReport.Time = 0
[B]low[/B](LED0)
[B]low[/B](LED1)
// connect to USB...
[B]repeat[/B]
[B]until [/B]HID.Connected
// main program loop...
[B]while true[/B]
// if we have data, set port values, update message
// and then reset time counter...
[B]if [/B]DataAvailable [B]then[/B]
ReadReport
LED0 = RXReport.LED0
LED1 = RXReport.LED1
TXReport.Message = "PORT CHANGED"
[B]WriteReport[/B]
TXReport.Time = 0
[B]delayms[/B](100)
// no data, set waiting message...
[B]else[/B]
TXReport.Message = "WAITING..."
[B]WriteReport[/B]
[B]inc[/B](TXReport.Time)
[B]endif[/B]
[B]wend[/B]
bloody-orc said:C seems to create a LOT faster and smaller code too, but then again ASM is a lot faster and smaller.
bloody-orc said:well... C for instance is a good language, basic is a boring one....
Back to language wars...gramo said:It comes down to the compiler and programming techniques - nothing to do with the language (even Assembler) for most, if not all cases.
There are even many "C" or "Basic" compilers that don't even offer a module approach to programming... that’s how significantly different things can be.