Author Topic: Software Serial doesn't recognize 16.5Mhz  (Read 7535 times)

Trakkasure

  • Newbie
  • *
  • Posts: 28
Software Serial doesn't recognize 16.5Mhz
« on: January 22, 2013, 06:57:48 pm »
I just received my radio blocks... while trying to run the test sketches, the DigiSpark arduino didn't wanna compile the SoftwareSerial code.


Arduino.app/Contents/Resources/Java/libraries/SoftwareSerial/SoftwareSerial.cpp line 57:
Update to:
#if F_CPU == 16000000 || F_CPU == 16500000


Allows it to compile. Not sure if it works yet.
I need to setup both nodes first to test the radio transmission.
I'll update later.

digistump

  • Administrator
  • Hero Member
  • *****
  • Posts: 1465
Re: Software Serial doesn't recognize 16.5Mhz
« Reply #1 on: January 22, 2013, 08:16:22 pm »
I've been working on timing setting for 16.5Mhz but had to jump back on concentrating on shipping this week.


Here is where I left off on them:


Code: [Select]

#elif F_CPU == 16500000


static const DELAY_TABLE PROGMEM table[] =
{
  //  baud    rxcenter   rxintra    rxstop    tx
  { 115200,   1,         18,        18,       12,    },
  { 57600,    10,        38,        38,       34,    },
  { 38400,    26,        59,        59,       56,    },
  { 31250,    32,        72,        72,       70,    },
  { 28800,    35,        79,        79,       76,    },
  { 19200,    56,        121,       121,      118,   },
  { 14400,    76,        161,       161,      158,   },
  { 9600,     118,       243,       243,      240,   },
  { 4800,     240,       489,       489,      486,   },
  { 2400,     486,       980,       980,      977,   },
  { 1200,     977,       1961,      1961,     1958,  },
  { 600,      1961,      3923,      3923,     3919,  },
  { 300,      3923,      7855,      7855,     7852,  },
};


const int XMIT_START_ADJUSTMENT = 5;




When the Radioblock kickstarter claimed to be digispark ready I let the creator know that it might take some work to support - perhaps ask him about it as well - so I can't say if it will work out of the box, but the timings above should be a good start.

Trakkasure

  • Newbie
  • *
  • Posts: 28
Re: Software Serial doesn't recognize 16.5Mhz
« Reply #2 on: January 22, 2013, 08:47:56 pm »
Thanks for the code.


I've posted in their forum too.


-- Brandon

semicolo

  • Full Member
  • ***
  • Posts: 137
Re: Software Serial doesn't recognize 16.5Mhz
« Reply #3 on: January 23, 2013, 05:32:15 am »
Using 16Mhz timings at 16.5Mhz is only 3.125% off, it should work reliably enough for you to do some testings until you have this figured out.